GaMS-DPO-Translator is a fine-tuned version of GaMS-9B-Instruct. Direct Preference Optimization (DPO) was performed on the original model. The learning dataset was synthetially generated by using GaMS-9B-Instruct and EuroLLM-9B-Instruct.
1from transformers import pipeline
2
3model_id = "DarioVajda/GaMS-DPO-Translator"
4
5pline = pipeline(
6 "text-generation",
7 model=model_id,
8 device_map="cuda" # replace with "mps" to run on a Mac device
9)
10
11# Example of response generation
12message = [{"role": "user", "content": "Prevedi naslednje angleško besedilo v slovenščino.\nToday is a nice day."}]
13response = pline(message, max_new_tokens=512)
14print("Translation:", response[0]["generated_text"][-1]["content"])
1from transformers import pipeline
2
3model_id = "DarioVajda/GaMS-DPO-Translator"
4
5pline = pipeline(
6 "text-generation",
7 model=model_id,
8 device_map="auto"
9)
10
11# Example of response generation
12message = [{"role": "user", "content": "Prevedi naslednje angleško besedilo v slovenščino.\nToday is a nice day."}]
13response = pline(message, max_new_tokens=512)
14print("Model's response:", response[0]["generated_text"][-1]["content"])
15
16# Example of conversation chain
17new_message = response[0]["generated_text"]
18new_message.append({"role": "user", "content": "Lahko bolj podrobno opišeš ta dogodek?"})
19response = pline(new_message, max_new_tokens=1024)
20print("Model's response:", response[0]["generated_text"][-1]["content"])
Data for fine-tuning the original model was acquired by translating a large corpora of wikipedia articles by two models (GaMS-9B-Instruct and EuroLLM-9B-Instruct) which were then ranked by some automatic metrics for translation quality and reliability.
The model was trained on the
Vega HPC
The model was evaluated by Slobench and we expanded the evaluation to measure some other qualities of the model we care about.
This evaluation was performed on data which was not seen during training. We checked how often the model would make some fatal error and later compared the COMET scores.