Update README.md
Browse files
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 |
-
|
30 |
-
TRANSLATION_MODEL = TransformerModel.from_pretrained('path/to/
|
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)
|