GaMS-Translator
Collection
GaMS based machine translator specialised for translating to Slovene • 3 items • Updated
GaMS3-12B-GRPO-Translator is a fine-tuned version of GaMS3-12B model, specialized for English to Slovene translation. The model was specilaized through 3 training phases (each phase trained a LoRA adapter):
The model can be used as a standard chat/instruct model. It uses the same chat template as cjvt/GaMS3-12B-Instruct
We trained the model using the following translation prompt. We suggest the same prompt is used during the inference.
Si profesionalni prevajalec iz angleščine v slovenščino. Tvoja naloga je ustvariti visoko kakovostne prevode, ki so naravni, tekoči in natančni. Izogibaj se dobesednim prevodom, ki zvenijo nenaravno. Upoštevaj kontekst, idiome in kulturne reference. Ne dodajaj nobenih dodatnih informacij ali komentarjev, samo prevod.
Prevedi podano angleško besedilo v slovenščino.
{{ English text }}
The model can be run through pipeline API using the following code:
from transformers import pipeline
model_id = "cjvt/GaMS3-12B-GRPO-Translator"
model = pipeline(
"text-generation",
model=model_id,
device_map="cuda" # replace with "mps" to run on a Mac device
)
# Example of response generation
prompt_template = "Si profesionalni prevajalec iz angleščine v slovenščino. Tvoja naloga je ustvariti visoko kakovostne prevode, ki so naravni, tekoči in natančni. Izogibaj se dobesednim prevodom, ki zvenijo nenaravno. Upoštevaj kontekst, idiome in kulturne reference. Ne dodajaj nobenih dodatnih informacij ali komentarjev, samo prevod.\n\nPrevedi podano angleško besedilo v slovenščino."
english_text = "This is the text to translate."
message = [{"role": "user", "content": f"{prompt_template}\n\n{english_text}"}]
response = model(message, max_new_tokens=512)
print("Transltion:", response[0]["generated_text"][-1]["content"])
The model is supported in vLLM the same way as GaMS3-12B-Instruct (and Gemma 3). Example vLLM code:
from vllm import LLM, SamplingParams
model = LLM("cjvt/GaMS3-12B-GRPO-Translator")
sampling_params = SamplingParams(
n=1,
temperature=0.2,
top_p=0.9,
max_tokens=1024
)
prompt_template = "Si profesionalni prevajalec iz angleščine v slovenščino. Tvoja naloga je ustvariti visoko kakovostne prevode, ki so naravni, tekoči in natančni. Izogibaj se dobesednim prevodom, ki zvenijo nenaravno. Upoštevaj kontekst, idiome in kulturne reference. Ne dodajaj nobenih dodatnih informacij ali komentarjev, samo prevod.\n\nPrevedi podano angleško besedilo v slovenščino."
english_text = "This is the text to translate."
message = [{"role": "user", "content": f"{prompt_template}\n\n{english_text}"}]
response = model.chat(messages, sampling_params)
print("Translation:", response[0].outputs[0].text)