Translation
Safetensors
English
German
marian
odegiber commited on
Commit
17c66b0
·
verified ·
1 Parent(s): 6f22d87

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_deu-eng", max_length=256)
29
- >>> pipe("Hallo, wie geht's dir?")
 
 
 
 
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_deu-eng"
29
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
30
+ model = MarianMTModel.from_pretrained(model_name)
31
+ tok = tokenizer("Hallo, wie geht es dir?", 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+ | 37.6 | 64.4 | 0.8623 |
48
+ | Bouquet | 37.6 | 59.9 | 0.8556 |
49
 
50