Update README.md
Browse filesAdded sample python code.
README.md
CHANGED
@@ -17,4 +17,23 @@ library_name: transformers
|
|
17 |
* A French -> Breton Translation Model called **Gallek** (meaning "French" in Breton).
|
18 |
* The current model version reached a **BLEU score of 40** on a 20% split of the training set.
|
19 |
* Only monodirectionally fr->br fine-tuned for now.
|
20 |
-
* Training details available on the [GweLLM Github repository](https://github.com/blackccpie/GweLLM).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
* A French -> Breton Translation Model called **Gallek** (meaning "French" in Breton).
|
18 |
* The current model version reached a **BLEU score of 40** on a 20% split of the training set.
|
19 |
* Only monodirectionally fr->br fine-tuned for now.
|
20 |
+
* Training details available on the [GweLLM Github repository](https://github.com/blackccpie/GweLLM).
|
21 |
+
|
22 |
+
Sample test code:
|
23 |
+
```python
|
24 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
25 |
+
|
26 |
+
modelcard = "amurienne/gallek-m2m100"
|
27 |
+
|
28 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(modelcard)
|
29 |
+
tokenizer = AutoTokenizer.from_pretrained(modelcard)
|
30 |
+
|
31 |
+
translation_pipeline = pipeline("translation", model=model, tokenizer=tokenizer, src_lang='fr', tgt_lang='br', max_length=512, device="cpu")
|
32 |
+
|
33 |
+
french_text = "traduis de français en breton: j'apprends le breton à l'école."
|
34 |
+
|
35 |
+
result = translation_pipeline(french_text)
|
36 |
+
print(result[0]['translation_text'])
|
37 |
+
```
|
38 |
+
|
39 |
+
Demo is available on the [Gallek Space](https://huggingface.co/spaces/amurienne/Gallek)
|