Downloads · 30 days
31
13% of all-time downloads
MathematicianNLPer/GemMaroc-4b-tulu-Q4_K_M-GGUF
GemMaroc-4b-tulu-Q4_K_M-GGUF is a text generation model from MathematicianNLPer. Use it when you need the model to write or continue text.
This model was converted to GGUF format from GemMaroc/GemMaroc-4b-tulu using llama.cpp via the ggml.ai's GGUF-my-repo space. Refer to the original model card for more details on the model.
Downloads · 30 days
31
13% of all-time downloads
All-time downloads
241
Public
Repo size
2.5 GB
Likes
0
Public
Click a slice to open those files.
.gguf2.5 GB · 100%
From the Hugging Face model README
This model was converted to GGUF format from GemMaroc/GemMaroc-4b-tulu using llama.cpp via the ggml.ai's GGUF-my-repo space.
Refer to the original model card for more details on the model.
Install llama.cpp through brew (works on Mac and Linux)
brew install llama.cpp
Invoke the llama.cpp server or the CLI.
llama-cli --hf-repo AbderrahmanSkiredj1/GemMaroc-4b-tulu-Q4_K_M-GGUF --hf-file gemmaroc-4b-tulu-q4_k_m-imat.gguf -p "The meaning to life and the universe is"
llama-server --hf-repo AbderrahmanSkiredj1/GemMaroc-4b-tulu-Q4_K_M-GGUF --hf-file gemmaroc-4b-tulu-q4_k_m-imat.gguf -c 2048
Note: You can also use this checkpoint directly through the usage steps listed in the Llama.cpp repo as well.
Step 1: Clone llama.cpp from GitHub.
git clone https://github.com/ggerganov/llama.cpp
Step 2: Move into the llama.cpp folder and build it with LLAMA_CURL=1 flag along with other hardware-specific flags (for ex: LLAMA_CUDA=1 for Nvidia GPUs on Linux).
cd llama.cpp && LLAMA_CURL=1 make
Step 3: Run inference through the main binary.
./llama-cli --hf-repo AbderrahmanSkiredj1/GemMaroc-4b-tulu-Q4_K_M-GGUF --hf-file gemmaroc-4b-tulu-q4_k_m-imat.gguf -p "The meaning to life and the universe is"
or
./llama-server --hf-repo AbderrahmanSkiredj1/GemMaroc-4b-tulu-Q4_K_M-GGUF --hf-file gemmaroc-4b-tulu-q4_k_m-imat.gguf -c 2048
library_name: transformers tags:
Unlocking Moroccan Darija proficiency in a state‑of‑the‑art large language model, trained with a minimal‑data, green‑AI recipe that preserves Gemma‑27B’s strong reasoning abilities while adding fluent Darija generation.
| Details | |
|---|---|
| Model ID | AbderrahmanSkiredj1/GemMaroc-27b-it |
| Base model | google/gemma-3-27b |
| Architecture | Decoder‑only Transformer (Gemma 3) |
| Parameters | 27 billion |
| Context length | 2 048 tokens |
| Training regime | Supervised fine‑tuning (LoRA → merged) on 50 K high‑quality Darija/English instructions TULU‑50K slice |
| Compute budget | 48 GPU·h (8 × H100‑80GB × 6 h) – ≈ 26 kWh / 10 kg CO₂e |
| License | Apache 2.0 |
| Model | Darija MMLU | Darija HellaSwag | GSM8K @5 | HellaSwag (EN) |
|---|---|---|---|---|
| Atlas‑Chat‑27B | 61.9 % | 48.4 % | 82.0 % | 77.8 % |
| GemMaroc‑27B | 61.6 % | 60.5 % | 84.2 % | 79.3 % |
<sub>Zero‑shot accuracy; full table in the paper.</sub>
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_id = "AbderrahmanSkiredj1/GemMaroc-27b-it"
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 (<bos>), then alternates user/model turns, each wrapped by <start_of_turn> … <end_of_turn> markers. When you set add_generation_prompt=True it ends after the opening model tag so the model can continue:
<bos><start_of_turn>user
{user message}<end_of_turn>
<start_of_turn>model
The assistant will keep generating tokens until it decides to emit <end_of_turn>.
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 (gemmaroc‑27b‑awq‑int4, gemmaroc‑27b‑gguf‑q4_k_m).
peft.merge_and_unload), convert to safetensors, upload.If you use GemMaroc 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},
}