Downloads · 30 days
4
4% of all-time downloads
alabenayed/improved-aya-expanse-8b-cpt-tunisian
improved-aya-expanse-8b-cpt-tunisian is a text generation model from alabenayed. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This is a LoRA adapter trained on the Tunisian Arabic dialect using the Aya Expanse 8B base model through Continued Pre-Training (CPT).
Downloads · 30 days
4
4% of all-time downloads
All-time downloads
94
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.safetensors671 MB · 66%
From the Hugging Face model README
This is a LoRA adapter trained on the Tunisian Arabic dialect using the Aya Expanse 8B base model through Continued Pre-Training (CPT).
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"CohereLabs/aya-expanse-8b",
device_map="auto",
trust_remote_code=True
)
# Load Tunisian adapter
model = PeftModel.from_pretrained(
base_model,
"alabenayed/improved-aya-expanse-8b-cpt-tunisian",
device_map="auto"
)
model.eval()
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(
"alabenayed/improved-aya-expanse-8b-cpt-tunisian",
trust_remote_code=True
)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
# Generate with chat template
def generate_prompt(prompt: str, max_new_tokens: int = 160):
messages = [{"role": "user", "content": prompt}]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
)
device = next(model.parameters()).device
inputs = {k: v.to(device) for k, v in inputs.items()}
outputs = model.generate(
**inputs,
max_new_tokens=max_new_tokens,
temperature=0.7,
do_sample=True,
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Try with Tunisian prompts
prompts = [
"عسلامة تحكي تونسي ؟", # How are you speaking Tunisian?
"اليوم الطقس مزيان شنوة نجم نعمل؟", # Today's weather is nice, what can we do?
"اش نجم نقول لصاحبي باش نهنيه بعيد ميلادو؟", # What can I say to my friend on his birthday?
]
for prompt in prompts:
output = generate_prompt(prompt)
print(f"📝 {prompt}\n💬 {output}\n")
✅ Tunisian Arabic text generation
✅ Conversational AI in Tunisian dialect
✅ Fine-tuning base for downstream tasks
✅ Multilingual models with Tunisian support
Use this adapter with other Tunisian datasets or for domain-specific fine-tuning tasks.
r=16 (rank)α=32 (scaling)dropout=0.05| Step | Loss | Eval Loss |
|---|---|---|
| 0 | 2.500 | - |
| 1,000 | 2.260 | 2.214 |
| 2,000 | 2.194 | 2.193 |
| 3,000 | 2.150 | 2.132 |
| 4,000 | 2.123 | 2.098 |
| 5,113 | 2.105 | 2.089 |
⚠️ Best performance on Tunisian Arabic text
⚠️ May require additional fine-tuning for domain-specific tasks
⚠️ Inherits limitations from base Aya Expanse 8B model
@misc{tunisian-llm-2026,
author = {MohamedAla-Benayed},
title = {Improved Aya Expanse 8B CPT Tunisian},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/alabenayed/improved-aya-expanse-8b-cpt-tunisian}}
}
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]