Translation
Fairseq
English
Icelandic
wmt
atlijas commited on
Commit
2767f79
1 Parent(s): cf72b53

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -26,8 +26,8 @@ This is the base version of our model. See also: [base_deep](hlekkur), [big](hle
26
 
27
  ```python
28
  from fairseq.models.transformer import TransformerModel
29
- TRANSLATION_MODEL_PATH = 'path/to/model.pt'
30
- TRANSLATION_MODEL = TransformerModel.from_pretrained('path/to/path', checkpoint_file=TRANSLATION_MODEL_PATH, 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)
 
26
 
27
  ```python
28
  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)