Skip to content

Commit

Permalink
fix flake8 errors
Browse files Browse the repository at this point in the history
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
  • Loading branch information
seemethere committed Dec 1, 2020
1 parent d0dd4d0 commit 100a855
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/common/torchtext_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def make_mock_dataset(self, num_examples=30, num_labels=3):

texts = [str(i) for i in range(num_examples)]
labels = list(range(num_labels)) * num_repetitions
labels = [str(l) for l in labels[:num_examples]]
labels = [str(line) for line in labels[:num_examples]]

dict_dataset = [
{'text': t, 'label': l} for t, l in zip(texts, labels)
Expand Down
6 changes: 3 additions & 3 deletions torchtext/datasets/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def clean(path):
f_txt = f_orig.replace('.tags', '')
with codecs.open(f_txt, mode='w', encoding='utf-8') as fd_txt, \
io.open(f_orig, mode='r', encoding='utf-8') as fd_orig:
for l in fd_orig:
if not any(tag in l for tag in xml_tags):
fd_txt.write(l.strip() + '\n')
for line in fd_orig:
if not any(tag in line for tag in xml_tags):
fd_txt.write(line.strip() + '\n')


class WMT14(TranslationDataset):
Expand Down

0 comments on commit 100a855

Please sign in to comment.