Skip to content

Commit

Permalink
Fix beam size argument when translating with fairseq
Browse files Browse the repository at this point in the history
  • Loading branch information
jvamvas committed May 2, 2024
1 parent 83d5bed commit 908c67e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion experiments/reference_aggregation/baseline_beam_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def main(testset: str, language_pair: str, beam_size: int = 4, limit_segments: i
translations_dir.mkdir(exist_ok=True)
out_path = translations_dir / f"{dataset}.beam{beam_size}.{dataset.tgt_lang}"

translations = model.translate(dataset.source_sentences, beam_size=beam_size)
translations = model.translate(dataset.source_sentences, beam=beam_size)
assert len(translations) == len(dataset.source_sentences)

with open(out_path, "w") as f:
Expand Down

0 comments on commit 908c67e

Please sign in to comment.