You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Access to Naturecode Dhivehi requires approval. This model is intended for research and development purposes for the Dhivehi language community. Please provide your intended use case for review.

Log in or Sign Up to review the conditions and access this model content.

Naturecode Dhivehi

The first production-ready Dhivehi language model for the Maldives.

Naturecode Dhivehi is a fine-tuned version of Qwen3-8B, trained specifically for the Dhivehi language (ދިވެހި) with comprehensive instruction-following capabilities.

Model Details

Attribute Value
Base Model Qwen/Qwen3-8B
Training Method CPT + SFT with LoRA
LoRA Rank 64
LoRA Alpha 128
Languages Dhivehi (ދިވެހި), English

Capabilities

  • Formal Writing: Letters, proposals, applications, official documents
  • Informal Dhivehi: Chat, social media, texting (romanized & Thaana)
  • Creative Writing: Stories, poems, songs, Boduberu lyrics
  • Cultural Knowledge: Maldivian traditions, customs, Islamic practices
  • Translation: English to Dhivehi bidirectional
  • Q&A: General knowledge about Maldives, geography, history
  • Technical Writing: Reports, documentation, explanations

Important: System Prompt

For best results, always use this system prompt:

ތިބާއަކީ ދިވެހި ބަހުގެ އެހީތެރިއެކެވެ. ކޮންމެ ޖަވާބެއްގައި މަދުވެގެން 5-8 ޖުމްލަ ހިމެނެން ވާނެއެވެ. ތަފްސީލީ، ފުރިހަމަ ޖަވާބުތައް ދެއްވާށެވެ.

Translation: "You are a Dhivehi language assistant. Each response should contain at least 5-8 sentences. Provide detailed, complete answers."

Usage

With ms-swift (Recommended)

pip install ms-swift

swift infer \
    --model Qwen/Qwen3-8B \
    --adapters Naturecode/dhivehi \
    --stream true

With Transformers + PEFT

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen3-8B",
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-8B")

# Load adapter
model = PeftModel.from_pretrained(base_model, "Naturecode/dhivehi")

# System prompt
system = "ތިބާއަކީ ދިވެހި ބަހުގެ އެހީތެރިއެކެވެ. ކޮންމެ ޖަވާބެއްގައި މަދުވެގެން 5-8 ޖުމްލަ ހިމެނެން ވާނެއެވެ. ތަފްސީލީ، ފުރިހަމަ ޖަވާބުތައް ދެއްވާށެވެ."

messages = [
    {"role": "system", "content": system},
    {"role": "user", "content": "ދިވެހިރާއްޖޭގެ ވެރިރަށަކީ ކޮބާ؟"}
]

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, do_sample=True, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Example Output

Question: ދިވެހިރާއްޖޭގެ ވެރިރަށަކީ ކޮބާ؟

Response: ދިވެހިރާއްޖޭގެ ވެރިރަށަކީ މާލެއެވެ. މާލެއަކީ ދިވެހިރާއްޖޭގެ އެންމެ ބޮޑު ސިޓީ އަދި ސިޔާސީ، އިޤްތިޞާދީ، ސަޤާފީ މަރުކަޒެވެ. މި ރަށުގައި ގާތްގަނޑަކަށް 200,000 އެއްހާ މީހުން ދިރިއުޅެއެވެ. މާލެއަކީ ދުނިޔޭގެ އެންމެ ތޮއްޖެހިފައިވާ ސިޓީތަކުގެ ތެރެއިން ސިޓީއެކެވެ.

Maldives Knowledge

Fact Value
Capital މާލެ (Malé)
Islands ~1,200 total, ~200 inhabited
Population ~500,000
Currency Rufiyaa (ރުފިޔާ / MVR)
Religion Islam (100%)
Language Dhivehi (ދިވެހި)
Independence July 26, 1965

Training

Two-stage training approach:

  1. Continued Pretraining (CPT): Extended pretraining on Dhivehi text
  2. Supervised Fine-Tuning (SFT): Instruction tuning on curated Dhivehi data

Limitations

  • Best performance with the recommended system prompt
  • May occasionally mix English words in responses
  • Knowledge cutoff applies to recent events

Intended Use

  • Dhivehi language research and development
  • Building Dhivehi-language applications
  • Educational tools for the Maldivian community
  • Translation assistance

License

Apache 2.0

Citation

@misc{naturecode-dhivehi,
  title={Naturecode Dhivehi: A Production-Ready Dhivehi Language Model},
  author={Naturecode},
  year={2024},
  publisher={HuggingFace},
  url={https://huggingface.co/Naturecode/dhivehi}
}

Built for the Maldives

Downloads last month
200
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Naturecode/dhivehi

Base model

Qwen/Qwen3-8B-Base
Finetuned
Qwen/Qwen3-8B
Adapter
(508)
this model