alakxender/dhivehi-news-corpus
Viewer • Updated • 87.2k • 87
How to use mohamedrayyan/dhivehi-news-lora-qwen3-30b with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-30B-A3B")
model = PeftModel.from_pretrained(base_model, "mohamedrayyan/dhivehi-news-lora-qwen3-30b")A LoRA fine-tuned adapter that teaches Qwen3-30B-A3B to generate Dhivehi (Maldivian) news articles.
| Property | Value |
|---|---|
| Base Model | Qwen/Qwen3-30B-A3B |
| Training Method | LoRA (Low-Rank Adaptation) |
| LoRA Rank | 32 |
| Task Type | Causal Language Modeling |
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen3-30B-A3B",
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-30B-A3B")
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "mohamedrayyan/dhivehi-news-lora-qwen3-30b")
# Generate
prompt = "Write a Dhivehi news article with the title: މާލޭގައި ބޮޑު އަލިފާނުގެ ހާދިސާއެއް ހިނގައިފި"
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
The model was trained on instruction-following format:
User: Write a Dhivehi news article with the title: {title}
Assistant: {article content}
The fine-tuned model shows significant improvement over the base model for Dhivehi text generation:
Prompt:
Write a Dhivehi news article with the title: މާލޭގައި ބޮޑު އަލިފާނުގެ ހާދިސާއެއް ހިނގައިފި
Fine-Tuned Output:
މާލޭގައި ބޮޑު އަލިފާނުގެ ހާދިސާއެއް ހިނގައިފި އެވެ.
އިމާމް ނައިބު ރޭ މައުލޫމާތު ދެއްވަމުން މާލެ ކައުންސިލުން ވިދާޅުވީ މި ހާދިސާގައި މީހަކަށް އަނިޔާ ނުވާކަމަށާއި އެ މީހާ ހައްޔަރުކޮށްފައިވާ ކަމަށެވެ...
transformers>=4.40.0peft>=0.10.0torch>=2.0.0If you use this model, please cite:
@misc{dhivehi-news-lora-2026,
author = {mohamedrayyan},
title = {Dhivehi News LoRA for Qwen3-30B-A3B},
year = {2026},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/mohamedrayyan/dhivehi-news-lora-qwen3-30b}}
}
This model adapter follows the license of the base model (Qwen3-30B-A3B).