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
|
Download README.md from BeardedMonster/gemma-3-1b-translate-rl: direct link, hf CLI and curl.
- Browser
- Download file 5.21 kB
-
https://huggingface.co/BeardedMonster/gemma-3-1b-translate-rl/resolve/main/README.md
- Command line
-
hf download hf://BeardedMonster/gemma-3-1b-translate-rl/README.md
-
curl -L -o README.md https://huggingface.co/BeardedMonster/gemma-3-1b-translate-rl/resolve/main/README.md
5.21 kB
| library_name: transformers | |
| pipeline_tag: translation | |
| language: | |
| - en | |
| - yor | |
| - hau | |
| - ibo | |
| - pcm | |
| - efi | |
| - twi | |
| - ewe | |
| - fon | |
| - wol | |
| - swh | |
| - kin | |
| - som | |
| - orm | |
| - amh | |
| - tir | |
| - lug | |
| - lin | |
| - zul | |
| - xho | |
| - afr | |
| - sna | |
| - nya | |
| - sot | |
| - tsn | |
| - mlg | |
| - ibb | |
| - urh | |
| - bem | |
| - tum | |
| - run | |
| - ven | |
| - tso | |
| - nso | |
| - ssw | |
| - nbl | |
| - nde | |
| - sag | |
| - tiv | |
| - umb | |
| - kmb | |
| - mos | |
| - kik | |
| - luo | |
| - kam | |
| - bin | |
| - dag | |
| - oke | |
| - shi | |
| - dyu | |
| - bam | |
| - kbp | |
| - bbj | |
| - kon | |
| - kea | |
| - fat | |
| - knc | |
| - gaa | |
| - kab | |
| - nus | |
| - swc | |
| - lua | |
| - kqn | |
| - lun | |
| - iso | |
| - loz | |
| - wal | |
| - ach | |
| - tsc | |
| - vmw | |
| - kua | |
| - seh | |
| - nyn | |
| - her | |
| - yao | |
| - sid | |
| - ndc | |
| - men | |
| - kri | |
| - luy | |
| - ish | |
| - dua | |
| - bas | |
| - wes | |
| - tzm | |
| - ful | |
| - guw | |
| - lue | |
| - tll | |
| - zne | |
| - lub | |
| - crs | |
| - mfe | |
| - rnd | |
| - nyk | |
| - kwn | |
| - ndo | |
| - dje | |
| - ada | |
| - arz | |
| - sop | |
| - mgr | |
| - koo | |
| - cjk | |
| - cop | |
| - dop | |
| - bum | |
| - nba | |
| - nyu | |
| - dik | |
| - cce | |
| - chw | |
| - ttj | |
| - lam | |
| - nup | |
| - taq | |
| - alz | |
| - toi | |
| - ber | |
| - zgh | |
| - aar | |
| - bci | |
| - ary | |
| - aeb | |
| - teo | |
| - adh | |
| base_model: google/gemma-3-1b-it | |
| license: other | |
| tags: | |
| - translation | |
| - african-languages | |
| - gemma3 | |
| - en2african | |
| - grpo | |
| - archive | |
| **License: Free for commercial use, with required attribution to the author's work. If you use this model, or text it generated, in a product, service or publication, credit "Translation models by Aletheia AI" and cite the accompanying paper. This model is a derivative of Google Gemma 3, so the Gemma Terms of Use and Prohibited Use Policy also apply.** | |
| # gemma-3-1b-translate-rl | |
| **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. | |
| **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. | |
| The final model scores chrF++ 35.28 on FLORES+ devtest (54 languages, greedy decoding) and AfriCOMET 0.681 (40 languages). | |
| ## Branches | |
| | branch | what it is | status | | |
| |---|---|---| | |
| | `latest-m1` | Later checkpoint of the same RL run as the final model; not separately evaluated | earlier RL checkpoint, superseded by the final model | | |
| | `dpo-trial` | Two models in folders `modelA/` and `modelB/` | experimental preference-tuning trial, not recommended | | |
| | `main` | README only | no weights | | |
| The final model is published as `BeardedMonster/gemma-3-1b-translate-best` and is not copied into a branch here. | |
| ## How to load a branch | |
| 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. | |
| ```python | |
| import re, torch | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| repo = "BeardedMonster/gemma-3-1b-translate-rl" | |
| tok = AutoTokenizer.from_pretrained("BeardedMonster/gemma-3-1b-translate-best") | |
| model = AutoModelForCausalLM.from_pretrained(repo, revision="latest-m1", dtype=torch.bfloat16).cuda().eval() | |
| # for the trial models: revision="dpo-trial", subfolder="modelA" (or "modelB") | |
| msgs = [{"role": "user", "content": "Translate the text to Yoruba: Good morning, how are you?"}] | |
| enc = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True).to("cuda") | |
| with torch.no_grad(): | |
| out = model.generate(**enc, max_new_tokens=256, do_sample=False) | |
| raw = tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True) # "<yor> ..." | |
| print(re.sub(r"^<[a-z]{3}>\s*", "", raw.strip())) | |
| ``` | |
| ## Training summary | |
| 1. Base model: `google/gemma-3-1b-it`, with 125 single-token language tags `<iso>` (for example `<yor>`, `<ibo>`, `<nso>`). | |
| 2. SFT on English to African-language parallel and instruction data. | |
| 3. RL (GRPO) with a reference-free quality-estimation reward. | |
| The card of the final model has the full details. | |
| ## Intended use and limitations | |
| This repo is an archive of earlier checkpoints, kept so the runs can be reproduced. Use `BeardedMonster/gemma-3-1b-translate-best` for translation. | |
| * English to African language only. Other source languages and reverse directions are not trained. | |
| * Twenty tags have no SFT data and cannot be translated. | |
| * Some low-resource languages, such as Kanuri, Tamasheq, Dinka and the Arabic dialects, give rough drafts. | |
| * Translate one sentence or a short paragraph at a time. Split long documents into sentences. | |
| * Automatic metrics only, no human evaluation. | |
| * These are machine translations. Have them checked before using them where errors matter, such as medical, legal or safety-critical text. | |
| ## Citation and licence | |
| Paper in preparation | |
| ``` | |
| @misc{Gemma_mt_2026, | |
| title = {English-to-African-language translation with small Gemma-3 models: supervised fine-tuning and reinforcement learning}, | |
| author = {{AletheiaAI}}, | |
| year = {2026}, | |
| } | |
| ``` | |
| **Licence.** `license: other` (`commercial-use-with-attribution`). Commercial and non-commercial use, modification and redistribution are allowed, with required attribution: credit "Translation models by Aletheia AI" and cite the accompanying paper. These weights are a derivative of Google Gemma 3, so the [Gemma Terms of Use](https://ai.google.dev/gemma/terms) and Prohibited Use Policy also apply. | |