Downloads · 30 days
0
MathematicianNLPer/Qwen2.5-14B-Instruct-darija
Qwen2.5-14B-Instruct-darija is a text generation model from MathematicianNLPer. Use it when you need the model to write or continue text. It is set up for transformers.
Unlocking Moroccan Darija proficiency in a powerful large language model, trained with a minimal-data, green-AI recipe that preserves Qwen2.5-14B-Instruct's strong reasoning abilities while adding fluent Darija genera…
Downloads · 30 days
0
Access
Public
Updated Oct 6, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md6.4 KB · 81%
From the Hugging Face model README
Unlocking Moroccan Darija proficiency in a powerful large language model, trained with a minimal-data, green-AI recipe that preserves Qwen2.5-14B-Instruct's strong reasoning abilities while adding fluent Darija generation.
| Details | |
|---|---|
| Model ID | AbderrahmanSkiredj1/Qwen2.5-14B-Instruct-darija |
| Base model | Qwen/Qwen2.5-14B-Instruct |
| Architecture | Decoder-only Transformer (Qwen2.5) |
| Parameters | 14 billion |
| Context length | 32,768 tokens |
| Training regime | Supervised fine-tuning (LoRA → merged) on 50 K high-quality Darija/English instructions TULU-50K slice |
| Compute budget | 32 GPU·h (8 × H100-80GB × 4 h) – ≈ 18 kWh / 7 kg CO₂e |
| License | Apache 2.0 |
| Model | Darija MMLU | Darija HellaSwag | Sentiment Analysis | GSM8K Darija | Summarization (chrF) | ROUGE-1 | ROUGE-L | BERTScore |
|---|---|---|---|---|---|---|---|---|
| Qwen2.5-14B-Instruct | 57.5 % | 45.9 % | 63.3 % | 72.3 % | 26.3 | 9.1 | 8.8 | 36.2 |
| Qwen2.5-14B-Instruct-darija | 57.6 % | 51.3 % | 64.1 % | 83.3 % | 27.1 | 7.3 | 7.1 | 38.8 |
| Model | MMLU | TruthfulQA | HellaSwag | GSM8K @5 | GSM8K Gen |
|---|---|---|---|---|---|
| Qwen2.5-14B-Instruct | 76.8 % | 70.8 % | 75.6 % | 80.2 % | 94.2 % |
| Qwen2.5-14B-Instruct-darija | 75.3 % | 61.7 % | 79.1 % | 75.6 % | 92.4 % |
<sub>Zero-shot accuracy; full table in the paper.</sub>
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_id = "AbderrahmanSkiredj1/Qwen2.5-14B-Instruct-darija"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto"
)
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
device_map="auto",
max_new_tokens=1024,
temperature=0.7,
repetition_penalty=1.2,
no_repeat_ngram_size=3,
)
messages = [
{"role": "user", "content": "شنو هي نظرية 'butterfly effect'؟ فسّرها بدارجة ونقّط مثال بسيط."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
print(pipe(prompt)[0]["generated_text"][len(prompt):])
The tokenizer provides a baked-in Jinja template that starts with a begin-of-sequence token (<|im_start|>), then alternates user/model turns, each wrapped by <|im_start|> … <|im_end|> markers. When you set add_generation_prompt=True it ends after the opening model tag so the model can continue:
<|im_start|>user
{user message}<|im_end|>
<|im_start|>assistant
The assistant will keep generating tokens until it decides to emit <|im_end|>.
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
No manual token juggling required—the call above handles BOS, turn delimiters, and newline placement automatically.
Pre-quantised checkpoints will be published under the same repo tags (qwen2.5-14b-darija-awq-int4, qwen2.5-14b-darija-gguf-q4_k_m).
peft.merge_and_unload), convert to safetensors, upload.If you use Qwen2.5-14B-Instruct-darija in your work, please cite:
@misc{skiredj2025gemmarocunlockingdarijaproficiency,
title={GemMaroc: Unlocking Darija Proficiency in LLMs with Minimal Data},
author={Abderrahman Skiredj and Ferdaous Azhari and Houdaifa Atou and Nouamane Tazi and Ismail Berrada},
year={2025},
eprint={2505.17082},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2505.17082},
}