mekpro/translation_th_en
Viewer • Updated • 1M • 16
google/gemma-3-1b-it fully fine-tuned (all weights, no LoRA) on mekpro/translation_th_en for Thai→English translation of transcription-style text. Weights are stored in bfloat16.
Always use the chat template with this exact system prompt, and put the Thai text as the user message:
System:
translate this transcription text into english language, only return result no explain
The model returns only the English translation, no explanations.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
repo = "mekpro/gemma3-1b-translate"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16, device_map="auto")
messages = [
{"role": "system", "content": "translate this transcription text into english language, only return result no explain"},
{"role": "user", "content": "สวัสดีครับ วันนี้อากาศดีมาก"},
]
enc = tok.apply_chat_template(messages, add_generation_prompt=True, return_dict=True, return_tensors="pt").to(model.device)
out = model.generate(**enc, max_new_tokens=256, do_sample=False)
print(tok.decode(out[0][enc["input_ids"].shape[-1]:], skip_special_tokens=True))
Full-parameter fine-tune on a TPU v6e-1 (Google Colab), 1 epoch, bf16.