Translation
LiteRT
Safetensors
English
French
marian
odegiber commited on
Commit
08b26e1
·
verified ·
1 Parent(s): 6c115b3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -5
README.md CHANGED
@@ -24,9 +24,13 @@ The configuration file fed into OpusDistillery can be found [here](https://githu
24
 
25
  ## How to run
26
  ```python
27
- >>> from transformers import pipeline
28
- >>> pipe = pipeline("translation", model="Helsinki-NLP/opus-mt_tiny_eng-fra", max_length=256)
29
- >>> pipe("Les efforts visant à trouver le lieu de l’accident sont restreints par des intempéries et le terrain accidenté.")
 
 
 
 
30
  ```
31
 
32
  ## Benchmarks
@@ -40,7 +44,7 @@ The configuration file fed into OpusDistillery can be found [here](https://githu
40
 
41
  | testset | BLEU | chr-F | COMET |
42
  |-----------------------|-------|-------|-------|
43
- | Flores+ | | | |
44
- | Bouquet | | | |
45
 
46
 
 
24
 
25
  ## How to run
26
  ```python
27
+ from transformers import MarianMTModel, MarianTokenizer
28
+ model_name = "Helsinki-NLP/opus-mt_tiny_eng-fra"
29
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
30
+ model = MarianMTModel.from_pretrained(model_name)
31
+ tok = tokenizer("Good morning, how are you?", return_tensors="pt").input_ids
32
+ output = model.generate(tok)[0]
33
+ tokenizer.decode(output, skip_special_tokens=True)
34
  ```
35
 
36
  ## Benchmarks
 
44
 
45
  | testset | BLEU | chr-F | COMET |
46
  |-----------------------|-------|-------|-------|
47
+ | Flores+ | 44.2 | 67.6 | 0.8321 |
48
+ | Bouquet | 40.4 | 63.6 | 0.8390 |
49
 
50