Skip to content

Commit 252ac10

Browse files
committed
WMT docs
1 parent 97b88f0 commit 252ac10

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/docs/wmt.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ multiple models, as it speeds up evaluation significantly.
172172
Below we show an implementation for a model from the torchhub repository. This
173173
incorporates all the features explained above: (a) using the WMT Evaluator,
174174
(b) accessing segments from evaluator, and (c) the evaluation caching logic.
175+
For clarity we omit batching and simply translate segment by segment.
175176

176177
``` python
177178
from sotabencheval.machine_translation import WMTEvaluator, WMTDataset, Language
@@ -188,7 +189,7 @@ evaluator = WMTEvaluator(
188189
)
189190

190191
model = torch.hub.load('pytorch/fairseq', 'transformer.wmt19.en-de.single_model',
191-
tokenizer='moses', bpe='fastbpe').cuda()
192+
force_reload=True, tokenizer='moses', bpe='fastbpe').cuda()
192193

193194
for sid, text in tqdm(evaluator.metrics.source_segments.items()):
194195
translated = model.translate(text)

0 commit comments

Comments
 (0)