Update README.md
Browse files
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(
|
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 |
|