Views
No views yet
1from transformers import pipeline
2
3pipe = pipeline("text-generation", model="nuinashco/gemma-3-1b-it-xlsum-ua-grpo", device="cuda")
4article = "Ваша стаття українською мовою..."
5prompt = f"Summarize the following article in Ukrainian:\n{article}"
6output = pipe(
7 [{"role": "user", "content": prompt}],
8 max_new_tokens=128,
9 return_full_text=False,
10)[0]
11print(output["generated_text"])| Hyperparameter | Value |
|---|---|
| Algorithm | GRPO (DAPO loss) |
| Base model | nuinashco/gemma-3-1b-it-xlsum-ua-sft |
| LoRA r / α | 32 / 32 |
| Reward | Toxicity (weight 1.0) |
| Reward model | textdetox/xlmr-large-toxicity-classifier-v2 |
| GRPO dataset | nuinashco/ukr-toxicity-processed |
| Rollouts per prompt | 8 |
| Max prompt length | 512 |
| Max completion length | 128 |
| Learning rate | 5e-6 |
| Batch size (per device) | 8 |
| KL penalty β | 0.03 |
| vLLM mode | colocate |
| Precision | bf16 |
1@misc{vonwerra2022trl,
2 title = {{TRL: Transformer Reinforcement Learning}},
3 author = {Leandro von Werra and Younes Belkada and Lewis Tunstall
4 and Edward Beeching and Tristan Thrush and Nathan Lambert
5 and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'{e}}dec},
6 year = 2020,
7 journal = {GitHub repository},
8 publisher = {GitHub},
9 howpublished = {\url{https://github.com/huggingface/trl}}
10}