Downloads · 30 days
26
14% of all-time downloads
Lyte/nanochat-darija-73m-instruct
nanochat-darija-73m-instruct is a text generation model from Lyte. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
Instruction-tuned NanoChat causal language model for Moroccan Darija.
Downloads · 30 days
26
14% of all-time downloads
All-time downloads
182
Public
Parameters
73.5M
148 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors147 MB · 96%
From the Hugging Face model README
Instruction-tuned NanoChat causal language model for Moroccan Darija.
This repo is exported in Hugging Face Transformers format with custom model code. Load it with trust_remote_code=True.
This is a pilot/test checkpoint, not the final full-data model. It was trained to validate the Darija data pipeline, tokenizer, NanoChat architecture export, and SFT workflow before a larger billion-plus-token training run.
The cleaned base corpus contains 5M Darija rows and approximately 2B tokens with the included tokenizer. That number describes the available cleaned corpus; this checkpoint was intentionally trained on a much smaller/shorter schedule.
20483276863843d6_target1210000bfloat16Lyte/nanochat-darija-73m-baseContinued with supervised fine-tuning on Moroccan Darija instruction data.
The instruction-tuned variant is small and experimental. It is useful for lightweight Darija chat tests, but it is not reliable for math, factuality, code debugging, translation fidelity, or safety-critical decisions.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Lyte/nanochat-darija-73m-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [{"role": "user", "content": "جاوبني بالدارجة: شنو هي أحسن طريقة نتعلم بها البرمجة؟"}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
if not hasattr(inputs, "shape"):
inputs = inputs["input_ids"]
outputs = model.generate(
inputs,
max_new_tokens=256,
temperature=0.3,
top_k=300,
top_p=0.95,
repetition_penalty=1.1,
do_sample=True,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=False))
model.safetensors: model weightsconfig.json: NanoChat architecture configgeneration_config.json: default sampling configtokenizer.json, tokenizer_config.json, special_tokens_map.json: tokenizer filesconfiguration_nanochat.py, modeling_nanochat.py: custom Transformers codenanochat_export.json: source checkpoint metadataThis is a tiny model. Expect fluent-looking but wrong answers, repetition on some prompts, and brittle instruction following. Use it as a research artifact or local baseline, not as a production assistant.