Downloads · 30 days
11
6% of all-time downloads
Sheikhaei/llama-3.2-1b-en-zh-translator
llama-3.2-1b-en-zh-translator is a text generation model from Sheikhaei. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
[](https://huggingface.co/spaces/Sheikhaei/llama-3.2-1b-en-zh-translator)
Downloads · 30 days
11
6% of all-time downloads
All-time downloads
189
Public
Parameters
1.2B
2.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.5 GB · 99%
From the Hugging Face model README
This model is a fine-tuned version of meta-llama/Llama-3.2-1B, trained for bidirectional translation between English and Mandarin. It supports both:
The model expects prompts in the following format:
### English:
The children were playing in the park.
### Mandarin:
or
### Mandarin:
孩子们在公园里玩耍。
### English:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Sheikhaei/llama-3.2-1b-en-zh-translator", torch_dtype="auto", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("Sheikhaei/llama-3.2-1b-en-zh-translator")
prompt = """### English:
The children were playing in the park.
### Mandarin:
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model was fine-tuned on a custom English–Mandarin parallel dataset containing ~640,000 sentence pairs. The source data was collected from Tatoeba and then translated and expanded using the Gemma-3-12B model.
| Direction | BLEU | COMET |
|---|---|---|
| English → Mandarin | 0.47 | 0.87 |
| Mandarin → English | 0.44 | 0.89 |
Apache 2.0