Views
No views yet
<your-username>/qwen2.5-0.5b-mono-es)Translate this from English to Spanish:\nEnglish: {src}\nSpanish: {tgt}, with the loss masked (-100) over the prompt/source span so only the Spanish completion is supervisedper_device_train_batch_size=8 x gradient_accumulation_steps=4), max sequence length 256Helsinki-NLP/tatoeba_mt (eng-spa) test sentences, disjoint from all training data:| Model | Prompting | BLEU |
|---|---|---|
| Qwen2.5-0.5B (pretrained) | 5-shot | 30.54 |
| Qwen2.5-0.5B + mono-es pretrain only | 5-shot | 29.59 |
| This model (full ALMA) | 0-shot | 44.91 |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3tokenizer = AutoTokenizer.from_pretrained("<your-username>/qwen2.5-0.5b-alma-es")
4model = AutoModelForCausalLM.from_pretrained("<your-username>/qwen2.5-0.5b-alma-es")
5
6prompt = "Translate this from English to Spanish:\nEnglish: Good morning.\nSpanish:"
7inputs = tokenizer(prompt, return_tensors="pt")
8output = model.generate(**inputs, max_new_tokens=64, do_sample=False)
9print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))