Instructions to use BeardedMonster/gemma-3-1b-translate-rl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BeardedMonster/gemma-3-1b-translate-rl with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("translation", model="BeardedMonster/gemma-3-1b-translate-rl")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BeardedMonster/gemma-3-1b-translate-rl", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Model card: plainer wording
Browse files
README.md
CHANGED
|
@@ -143,9 +143,11 @@ tags:
|
|
| 143 |
|
| 144 |
# gemma-3-1b-translate-rl
|
| 145 |
|
| 146 |
-
**What this is.**
|
| 147 |
|
| 148 |
-
|
|
|
|
|
|
|
| 149 |
|
| 150 |
## Branches
|
| 151 |
|
|
@@ -155,11 +157,11 @@ Headline of the final model (FLORES+ devtest, 54 languages, greedy decoding): ch
|
|
| 155 |
| `dpo-trial` | Two models in folders `modelA/` and `modelB/` | experimental preference-tuning trial, not recommended |
|
| 156 |
| `main` | README only | no weights |
|
| 157 |
|
| 158 |
-
The final model
|
| 159 |
|
| 160 |
## How to load a branch
|
| 161 |
|
| 162 |
-
The prompt is one user turn
|
| 163 |
|
| 164 |
```python
|
| 165 |
import re, torch
|
|
@@ -180,21 +182,22 @@ print(re.sub(r"^<[a-z]{3}>\s*", "", raw.strip()))
|
|
| 180 |
|
| 181 |
## Training summary
|
| 182 |
|
| 183 |
-
1.
|
| 184 |
-
2.
|
| 185 |
-
3.
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
## Intended use and limitations
|
| 190 |
|
| 191 |
-
|
| 192 |
|
| 193 |
-
*
|
| 194 |
-
*
|
| 195 |
-
*
|
| 196 |
-
*
|
| 197 |
-
*
|
|
|
|
| 198 |
|
| 199 |
## Citation and licence
|
| 200 |
|
|
|
|
| 143 |
|
| 144 |
# gemma-3-1b-translate-rl
|
| 145 |
|
| 146 |
+
**What this is.** An archive of earlier checkpoints of our Gemma-3-1B English to African-language translator. It covers 125 language tags and goes from English into African languages only. Each branch holds one set of weights, and `main` holds only this README.
|
| 147 |
|
| 148 |
+
**For normal use, take the final model instead: [`BeardedMonster/gemma-3-1b-translate-best`](https://huggingface.co/BeardedMonster/gemma-3-1b-translate-best).** Its card has the prompt format, code and full per-language results.
|
| 149 |
+
|
| 150 |
+
The final model scores chrF++ 35.28 on FLORES+ devtest (54 languages, greedy decoding) and AfriCOMET 0.681 (40 languages).
|
| 151 |
|
| 152 |
## Branches
|
| 153 |
|
|
|
|
| 157 |
| `dpo-trial` | Two models in folders `modelA/` and `modelB/` | experimental preference-tuning trial, not recommended |
|
| 158 |
| `main` | README only | no weights |
|
| 159 |
|
| 160 |
+
The final model is published as `BeardedMonster/gemma-3-1b-translate-best` and is not copied into a branch here.
|
| 161 |
|
| 162 |
## How to load a branch
|
| 163 |
|
| 164 |
+
The prompt is one user turn with two spaces after the colon. Use the language **name**, never the ISO code. The model answers with one language tag, then the translation.
|
| 165 |
|
| 166 |
```python
|
| 167 |
import re, torch
|
|
|
|
| 182 |
|
| 183 |
## Training summary
|
| 184 |
|
| 185 |
+
1. Base model: `google/gemma-3-1b-it`, with 125 single-token language tags `<iso>` (for example `<yor>`, `<ibo>`, `<nso>`).
|
| 186 |
+
2. SFT on English to African-language parallel and instruction data.
|
| 187 |
+
3. RL (GRPO) with a reference-free quality-estimation reward.
|
| 188 |
|
| 189 |
+
The card of the final model has the full details.
|
| 190 |
|
| 191 |
## Intended use and limitations
|
| 192 |
|
| 193 |
+
This repo is an archive of earlier checkpoints, kept so the runs can be reproduced. Use `BeardedMonster/gemma-3-1b-translate-best` for translation.
|
| 194 |
|
| 195 |
+
* English to African language only. Other source languages and reverse directions are not trained.
|
| 196 |
+
* Twenty tags have no SFT data and cannot be translated.
|
| 197 |
+
* Some low-resource languages, such as Kanuri, Tamasheq, Dinka and the Arabic dialects, give rough drafts.
|
| 198 |
+
* Translate one sentence or a short paragraph at a time. Split long documents into sentences.
|
| 199 |
+
* Automatic metrics only, no human evaluation.
|
| 200 |
+
* These are machine translations. Have them checked before using them where errors matter, such as medical, legal or safety-critical text.
|
| 201 |
|
| 202 |
## Citation and licence
|
| 203 |
|