Commit 0864a9c4 authored by Myle Ott's avatar Myle Ott Committed by Facebook Github Bot
Browse files

Fix build for docs

Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/372

Differential Revision: D13114426

Pulled By: myleott

fbshipit-source-id: 6c24b96a3556a0ecd3d1f350642a884254a40bd3
parent 2625b0a4
...@@ -24,7 +24,7 @@ class BacktranslationDataset(FairseqDataset): ...@@ -24,7 +24,7 @@ class BacktranslationDataset(FairseqDataset):
remove_eos_at_src=False, remove_eos_at_src=False,
generator_class=sequence_generator.SequenceGenerator, generator_class=sequence_generator.SequenceGenerator,
cuda=True, cuda=True,
**kwargs, **kwargs
): ):
""" """
Sets up a backtranslation dataset which takes a tgt batch, generates Sets up a backtranslation dataset which takes a tgt batch, generates
......
...@@ -242,7 +242,7 @@ class NoisingDataset(torch.utils.data.Dataset): ...@@ -242,7 +242,7 @@ class NoisingDataset(torch.utils.data.Dataset):
seed, seed,
noiser=None, noiser=None,
noising_class=UnsupervisedMTNoising, noising_class=UnsupervisedMTNoising,
**kwargs, **kwargs
): ):
""" """
Sets up a noising dataset which takes a src batch, generates Sets up a noising dataset which takes a src batch, generates
......
...@@ -120,7 +120,7 @@ def main(args): ...@@ -120,7 +120,7 @@ def main(args):
def file_name(prefix, lang): def file_name(prefix, lang):
fname = prefix fname = prefix
if lang is not None: if lang is not None:
fname += f".{lang}" fname += ".{lang}".format(lang=lang)
return fname return fname
def dest_path(prefix, lang): def dest_path(prefix, lang):
......
...@@ -146,8 +146,8 @@ class TestDataNoising(unittest.TestCase): ...@@ -146,8 +146,8 @@ class TestDataNoising(unittest.TestCase):
x[x_len[i] - 1][i], x[x_len[i] - 1][i],
eos, eos,
( (
"Expected eos (token id {eos}) at the end of sentence {i} but " "Expected eos (token id {eos}) at the end of sentence {i} "
"got {other} instead" "but got {other} instead"
).format(i=i, eos=eos, other=x[i][-1]), ).format(i=i, eos=eos, other=x[i][-1]),
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment