Views
No views yet

google/gemma-3-12b-pt. As it is intended solely for text generation, we have extracted and utilized only the Gemma3ForCausalLM component from the original architecture.yanolja/YanoljaNEXT-Rosetta-12B-2510google/gemma-3-12b-pttransformers library as follows:1import json
2import torch
3from transformers import AutoTokenizer, AutoModelForCausalLM
4
5model_id = "yanolja/YanoljaNEXT-Rosetta-12B-2510"
6model = AutoModelForCausalLM.from_pretrained(
7 model_id,
8 dtype=torch.bfloat16,
9 device_map="auto",
10 max_memory={0: "47GB"},
11)
12tokenizer = AutoTokenizer.from_pretrained(model_id)
13
14target_language = "Korean"
15context = {
16 "context": "Simple introduction about a tech company.",
17 "tone": "Informative and helpful",
18 "glossary": {
19 "Yanolja NEXT": "야놀자넥스트",
20 "travel industry": "여행 산업",
21 }
22}
23
24system = [f"Translate the user's text to {target_language}."]
25for key, value in context.items():
26 key_pascal = key.capitalize()
27 if isinstance(value, dict):
28 system.append(f"{key_pascal}:")
29 for f, t in value.items():
30 system.append(f"- {f} -> {t}")
31 else:
32 system.append(f"{key_pascal}: {value}")
33
34system.append("Provide the final translation immediately without any other text.")
35
36source = {
37 "company_name": "Yanolja NEXT",
38 "description": "Yanolja NEXT is a company that provides cutting-edge "
39 "technology for the global travel industry.",
40}
41
42messages = [
43 {"role": "system", "content": "\n".join(system)},
44 {"role": "user", "content": json.dumps(source, ensure_ascii=False)},
45]
46
47prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
48print(prompt)
49# <bos><start_of_turn>instruction
50# Translate the user's text to Korean.
51# Context: Simple introduction about a tech company.
52# Tone: Informative and helpful
53# Glossary:
54# - Yanolja NEXT -> 야놀자넥스트
55# - travel industry -> 여행 산업
56# Provide the final translation immediately without any other text.<end_of_turn>
57# <start_of_turn>source
58# {"company_name": "Yanolja NEXT", "description": "Yanolja NEXT is a company that provides cutting-edge technology for the global travel industry."}<end_of_turn>
59# <start_of_turn>translation
60
61inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
62input_length = inputs["input_ids"].shape[1]
63
64with torch.inference_mode():
65 outputs = model.generate(
66 **inputs,
67 max_new_tokens=64,
68 )
69
70generated_tokens = outputs[0][input_length:]
71translation = tokenizer.decode(generated_tokens, skip_special_tokens=True)
72
73print(json.dumps(json.loads(translation), indent=2, ensure_ascii=False))
74# {
75# "company_name": "야놀자넥스트",
76# "description": "야놀자넥스트는 글로벌 여행 산업에 최첨단 기술을 제공하는 회사입니다."
77# }| Model | CHrF++ Score (WMT24++) |
|---|---|
| yanolja/YanoljaNEXT-Rosetta-12B-2510 | 37.36 |
| openai/gpt-4o | 36.08 |
| google/gemini-2.5-flash | 35.25 |
| yanolja/YanoljaNEXT-Rosetta-12B | 34.75 |
| yanolja/YanoljaNEXT-Rosetta-20B | 33.87 |
| google/gemini-2.0-flash-001 | 33.81 |
| openai/gpt-oss-120b | 31.51 |
| google/gemma-3-27b-it | 30.05 |
| google/gemma-3-12b-pt | 29.31 |
google/gemma-3-12b-pt. Please consult the official Gemma license terms for detailed usage guidelines.@misc{yanolja2025yanoljanextrosetta,
author = {Yanolja NEXT Co., Ltd.},
title = {YanoljaNEXT-Rosetta-12B-2510},
year = {2025},
publisher = {Hugging Face},
journal = {Hugging Face repository},
howpublished = {\\url{https://huggingface.co/yanolja/YanoljaNEXT-Rosetta-12B-2510}}
}@misc{gemma3,
author = {Google},
title = {Gemma 3},
year = {2024},
publisher = {Google DeepMind},
howpublished = {\\url{https://deepmind.google/models/gemma/gemma-3/}}
}
@misc{penedo2025fineweb2pipelinescale,
title = {FineWeb2: One Pipeline to Scale Them All -- Adapting Pre-Training Data Processing to Every Language},
author = {Guilherme Penedo and Hynek Kydlíček and Vinko Sabolčec and Bettina Messmer and Negar Foroutan and Amir Hossein Kargaran and Colin Raffel and Martin Jaggi and Leandro Von Werra and Thomas Wolf},
year = {2025},
eprint = {2506.20920},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2506.20920},
}
@misc{lozhkov2024fineweb-edu,
author = {Lozhkov, Anton and Ben Allal, Loubna and von Werra, Leandro and Wolf, Thomas},
title = {FineWeb-Edu: the Finest Collection of Educational Content},
year = 2024,
url = {https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu},
doi = {10.57967/hf/2497},
publisher={Hugging Face}
}