Translation
Fairseq
English
Icelandic
wmt
atlijas commited on
Commit
9940781
1 Parent(s): 3d52e03

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -1
README.md CHANGED
@@ -29,7 +29,7 @@ from fairseq.models.transformer import TransformerModel
29
  TRANSLATION_MODEL_NAME = 'checkpoint_best.pt'
30
  TRANSLATION_MODEL = TransformerModel.from_pretrained('path/to/model', checkpoint_file=TRANSLATION_MODEL_NAME, bpe='sentencepiece', sentencepiece_model='sentencepiece.bpe.model')
31
  src_sentences = ['This is a test sentence.', 'This is another test sentence.']
32
- translated_sentences = translate(translation_model=TRANSLATION_MODEL, sentences=src_sentences, beam=5)
33
  print(translated_sentences)
34
  ```
35
 
 
29
  TRANSLATION_MODEL_NAME = 'checkpoint_best.pt'
30
  TRANSLATION_MODEL = TransformerModel.from_pretrained('path/to/model', checkpoint_file=TRANSLATION_MODEL_NAME, bpe='sentencepiece', sentencepiece_model='sentencepiece.bpe.model')
31
  src_sentences = ['This is a test sentence.', 'This is another test sentence.']
32
+ translated_sentences = TRANSLATION_MODEL.translate(src_sentences)
33
  print(translated_sentences)
34
  ```
35