File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ multiple models, as it speeds up evaluation significantly.
172172Below we show an implementation for a model from the torchhub repository. This
173173incorporates 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
177178from sotabencheval.machine_translation import WMTEvaluator, WMTDataset, Language
@@ -188,7 +189,7 @@ evaluator = WMTEvaluator(
188189)
189190
190191model = 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
193194for sid, text in tqdm(evaluator.metrics.source_segments.items()):
194195 translated = model.translate(text)
You can’t perform that action at this time.
0 commit comments