Views
No views yet
google/gemma-4-31B-it (31B parameters)q_proj and v_proj| Metric | Before | After |
|---|---|---|
| Quality | 2.0 | 5.9 (+195.0%) |
| Grade | E | C |
| Percentile | 0.1 | 7.2 |
| Win Rate | 46% | 54% |
1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4base_model = AutoModelForCausalLM.from_pretrained(
5 "google/gemma-4-31B-it",
6 torch_dtype="bfloat16",
7 device_map="auto"
8)
9model = PeftModel.from_pretrained(base_model, "morningstarxcdcode/adaption-opus-100-translation-model")
10tokenizer = AutoTokenizer.from_pretrained("morningstarxcdcode/adaption-opus-100-translation-model")
11
12inputs = tokenizer("Translate to French: The weather is nice today.", return_tensors="pt").to(model.device)
13outputs = model.generate(**inputs, max_new_tokens=256)
14print(tokenizer.decode(outputs[0], skip_special_tokens=True))