Views
No views yet
no-vision) conversion of google/translategemma-4b-it, saved in FP16 (safetensors).
The tokenizer is set from google/gemma-3-1b-it.Gemma3ForCausalLM checkpoint extracted from the language component of the original multimodal model:google/translategemma-4b-itGemma3ForCausalLM (text-only)float16 weights1SYSTEM_PROMPT = """You are a professional {source_lang} ({src_lang_code}) to {target_lang}
2({tgt_lang_code}) translator. Your goal is to accurately convey the meaning and
3nuances of the original {source_lang} text while adhering to {target_lang} grammar,
4vocabulary, and cultural sensitivities. Produce only the {target_lang}
5translation, without any additional explanations or commentary. Please translate
6the following {source_lang} text into {target_lang}:\n"""google/translategemma-4b-it page, similar to google/gemma-3-1b-it)1messages = [
2 {
3 "role" : "system",
4 "content": SYSTEM_PROMPT
5 },
6 {
7 "role": "user",
8 "content": <TEXT_TO_BE_TRANSLATED>
9 }
10]
11
12from unsloth import FastModel
13
14model, tokenizer = FastModel.from_pretrained(model)
15
16tokenizer.apply_chat_template(messages)