Views
No views yet

1from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
2
3model_id = "hammh0a/Hala-1.2B-EN-AR-Translator"
4
5tok = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(
7 model_id, torch_dtype="auto", device_map="auto"
8)
9
10pipe = pipeline("text-generation", model=model, tokenizer=tok)
11
12# Example English text
13text = "Physics is the study of matter, energy, and the interactions between them."
14
15messages = [
16 {
17 "role": "user",
18 "content": "Translate everything that follows into Arabic:\n\n" + text,
19 }
20]
21
22prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
23
24out = pipe(prompt, max_new_tokens=256, do_sample=False)
25
26print(out[0]["generated_text"])| System | BLEU ↑ | ROUGE-L ↑ | chrF++ ↑ |
|---|---|---|---|
| Teacher translator | |||
| CohereLabs/command-a-translate-08-2025 (FP16) | 53.1 | 26.0 | 68.6 |
| hammh0a/command-a-translate-FP8-Dynamic | 53.5 (+0.3) | 26.0 (+0.0) | 68.9 (+0.3) |
| Lightweight translator (LFM2-1.2B family) | |||
| LiquidAI/LFM2-1.2B (base) | 16.0 | 19.3 | 43.2 |
| Our LFM2-1.2B Translator (ours) | 48.2 (+32.1) | 25.1 (+5.9) | 64.2 (+21.0) |
1@misc{hammoud2025halatechnicalreportbuilding,
2 title={Hala Technical Report: Building Arabic-Centric Instruction & Translation Models at Scale},
3 author={Hasan Abed Al Kader Hammoud and Mohammad Zbeeb and Bernard Ghanem},
4 year={2025},
5 url={https://arxiv.org/abs/2509.14008},
6}