Views
No views yet
1base_model: google/gemma-3-12b-it
2dtype: bfloat16
3merge_method: slerp
4parameters:
5 t:
6 - filter: vision_tower
7 value: 0
8 - filter: multi_modal_projector
9 value: 0
10 - value: 0.5
11models:
12 - model: google/gemma-3-12b-it
13 - model: google/translategemma-12b-itvision_tower and multi_modal_projector weights are taken 100% from Gemma-3-12B-IT (t=0) to ensure visual stability, while the language model weights are a 50/50 SLERP merge (t=0.5).transformers library.1from transformers import Gemma3ForConditionalGeneration, AutoProcessor
2import torch
3
4model_id = "SpongeBOB9684/GemmaTranslate-v3-12B"
5
6model = Gemma3ForConditionalGeneration.from_pretrained(
7 model_id,
8 device_map="auto",
9 torch_dtype=torch.bfloat16
10)
11processor = AutoProcessor.from_pretrained(model_id)
12
13# Example: Multimodal Translation
14# (Add your image and prompt here)
15prompt = "Translate the text in this image to French and explain its context."
16# inputs = processor(text=prompt, images=image, return_tensors="pt").to(model.device)
17
18# Example: Text-only Translation
19prompt = "Translate the following English text to Japanese: 'The future of AI is multimodal.'"
20inputs = processor(text=prompt, return_tensors="pt").to(model.device)
21
22output = model.generate(**inputs, max_new_tokens=256)
23print(processor.decode(output[0], skip_special_tokens=True))