Qwen3-Izy-Translate-EN-TH-0.6B
This repository contains the safetensors weights for Qwen3-Izy-Translate-EN-TH-0.6B, a highly efficient, lightweight model fine-tuned for bidirectional English and Thai translation.
The model was trained 2x faster with Unsloth and Hugging Face's TRL library.
🚀 Model Details
- Developed by: izyya
- License: Apache-2.0
- Base Model:
unsloth/qwen3-0.6b-unsloth-bnb-4bit - Supported Languages: English (EN) and Thai (TH)
- Format: Hugging Face
safetensors
📝 Prompt Templates
For optimal translation quality, structure your inputs exactly as shown below depending on the translation direction.
English to Thai
Translate the following English text to Thai.
### English:
[Your English text here]
Thai to English
Translate the following Thai text to English.
### Thai:
[Your Thai text here]
🐍 Inference Code (Python / Transformers)
This snippet demonstrates how to load the model, pipe your translation prompt into it, and cleanly extract the output text.
from transformers import AutoModelForCausalLM, AutoTokenizer
# Replace with your actual Hugging Face repo path if it differs
model_name = "izyya/Qwen3-Izy-Translate-EN-TH-0.6B"
# Load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
# Prepare the translation snippet input
prompt = """
Translate the following English text to Thai.
### English:
But friends, I am so gay, that if I had a wife, I would encourage her to cheat on me.
"""
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# Conduct text completion
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):]
content = tokenizer.decode(output_ids, skip_special_tokens=True).strip("\n")
print("content:", content)
⚡ Acknowledgments
- Super-accelerated and fine-tuned with ❤️ by Unsloth.