Commit 2b68e91f authored by Myle Ott's avatar Myle Ott Committed by Facebook Github Bot
Browse files

Lint

Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/817

Differential Revision: D16762905

Pulled By: myleott

fbshipit-source-id: d920595bec44ed26b72dfc6fbc15c0aa107b4e56
parent 969f4474
...@@ -16,7 +16,6 @@ from fairseq.data.legacy.masked_lm_dictionary import MaskedLMDictionary ...@@ -16,7 +16,6 @@ from fairseq.data.legacy.masked_lm_dictionary import MaskedLMDictionary
from fairseq.data import ( from fairseq.data import (
ConcatDataset, ConcatDataset,
data_utils, data_utils,
indexed_dataset,
TokenBlockDataset, TokenBlockDataset,
) )
......
...@@ -3,22 +3,18 @@ ...@@ -3,22 +3,18 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
import itertools
import os import os
import numpy as np
import torch import torch
from fairseq import utils from fairseq import utils
from fairseq.data import ( from fairseq.data import (
ConcatDataset,
data_utils, data_utils,
Dictionary, Dictionary,
MonolingualDataset, MonolingualDataset,
TokenBlockDataset, TokenBlockDataset,
TransformEosDataset, TransformEosDataset,
TruncatedDictionary, TruncatedDictionary,
indexed_dataset
) )
from fairseq.tasks import FairseqTask, register_task from fairseq.tasks import FairseqTask, register_task
......
...@@ -3,20 +3,16 @@ ...@@ -3,20 +3,16 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
import itertools
import os import os
import numpy as np import numpy as np
import torch import torch
import torch.nn.functional as F
from fairseq.data import ( from fairseq.data import (
ConcatDataset,
data_utils, data_utils,
Dictionary, Dictionary,
encoders, encoders,
IdDataset, IdDataset,
indexed_dataset,
MaskTokensDataset, MaskTokensDataset,
NestedDictionaryDataset, NestedDictionaryDataset,
NumelDataset, NumelDataset,
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
from collections import OrderedDict from collections import OrderedDict
import copy
import os import os
import torch import torch
...@@ -15,7 +14,6 @@ from fairseq.data import ( ...@@ -15,7 +14,6 @@ from fairseq.data import (
LanguagePairDataset, LanguagePairDataset,
RoundRobinZipDatasets, RoundRobinZipDatasets,
TransformEosLangPairDataset, TransformEosLangPairDataset,
indexed_dataset,
) )
from fairseq.models import FairseqMultiModel from fairseq.models import FairseqMultiModel
from fairseq.tasks.translation import load_langpair_dataset from fairseq.tasks.translation import load_langpair_dataset
......
...@@ -15,7 +15,6 @@ from fairseq.data import ( ...@@ -15,7 +15,6 @@ from fairseq.data import (
NestedDictionaryDataset, NestedDictionaryDataset,
NumSamplesDataset, NumSamplesDataset,
NumelDataset, NumelDataset,
OffsetTokensDataset,
PrependTokenDataset, PrependTokenDataset,
RawLabelDataset, RawLabelDataset,
RightPadDataset, RightPadDataset,
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
import contextlib
import torch import torch
from fairseq import modules, utils from fairseq import modules, utils
......
...@@ -155,7 +155,6 @@ def replace_unk(hypo_str, src_str, alignment, align_dict, unk): ...@@ -155,7 +155,6 @@ def replace_unk(hypo_str, src_str, alignment, align_dict, unk):
def post_process_prediction(hypo_tokens, src_str, alignment, align_dict, tgt_dict, remove_bpe=None): def post_process_prediction(hypo_tokens, src_str, alignment, align_dict, tgt_dict, remove_bpe=None):
from fairseq import tokenizer
hypo_str = tgt_dict.string(hypo_tokens, remove_bpe) hypo_str = tgt_dict.string(hypo_tokens, remove_bpe)
if align_dict is not None: if align_dict is not None:
hypo_str = replace_unk(hypo_str, src_str, alignment, align_dict, tgt_dict.unk_string()) hypo_str = replace_unk(hypo_str, src_str, alignment, align_dict, tgt_dict.unk_string())
......
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