Translation
LiteRT
Safetensors
English
Russian
marian
odegiber commited on
Commit
baec1d4
·
verified ·
1 Parent(s): 8985def

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -5
README.md CHANGED
@@ -23,9 +23,13 @@ The configuration file fed into OpusDistillery can be found [here](https://githu
23
 
24
  ## How to run
25
  ```python
26
- >>> from transformers import pipeline
27
- >>> pipe = pipeline("translation", model="Helsinki-NLP/opus-mt_tiny_eng-rus", max_length=256)
28
- >>> pipe("Hello, how are you?")
 
 
 
 
29
  ```
30
 
31
  ## Benchmarks
@@ -39,5 +43,5 @@ The configuration file fed into OpusDistillery can be found [here](https://githu
39
 
40
  | testset | BLEU | chr-F | COMET |
41
  |-----------------------|-------|-------|-------|
42
- | Flores+ | | | |
43
- | Bouquet | | | |
 
23
 
24
  ## How to run
25
  ```python
26
+ from transformers import MarianMTModel, MarianTokenizer
27
+ model_name = "Helsinki-NLP/opus-mt_tiny_eng-rus"
28
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
29
+ model = MarianMTModel.from_pretrained(model_name)
30
+ tok = tokenizer("Hello, how are you?", return_tensors="pt").input_ids
31
+ output = model.generate(tok)[0]
32
+ tokenizer.decode(output, skip_special_tokens=True)
33
  ```
34
 
35
  ## Benchmarks
 
43
 
44
  | testset | BLEU | chr-F | COMET |
45
  |-----------------------|-------|-------|-------|
46
+ | Flores+ | 24.4 | 52.0 | 0.8122 |
47
+ | Bouquet | 28.0 |53.0 | 0.8243 |