"vscode:/vscode.git/clone" did not exist on "cac6cb1b7813a4f09a05e0ade43c63292bb08b79"
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
from fairseq.data import (
ConcatDataset,
data_utils,
indexed_dataset,
TokenBlockDataset,
)
......
......@@ -3,22 +3,18 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import os
import numpy as np
import torch
from fairseq import utils
from fairseq.data import (
ConcatDataset,
data_utils,
Dictionary,
MonolingualDataset,
TokenBlockDataset,
TransformEosDataset,
TruncatedDictionary,
indexed_dataset
)
from fairseq.tasks import FairseqTask, register_task
......
......@@ -3,20 +3,16 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import os
import numpy as np
import torch
import torch.nn.functional as F
from fairseq.data import (
ConcatDataset,
data_utils,
Dictionary,
encoders,
IdDataset,
indexed_dataset,
MaskTokensDataset,
NestedDictionaryDataset,
NumelDataset,
......
......@@ -4,7 +4,6 @@
# LICENSE file in the root directory of this source tree.
from collections import OrderedDict
import copy
import os
import torch
......@@ -15,7 +14,6 @@ from fairseq.data import (
LanguagePairDataset,
RoundRobinZipDatasets,
TransformEosLangPairDataset,
indexed_dataset,
)
from fairseq.models import FairseqMultiModel
from fairseq.tasks.translation import load_langpair_dataset
......
......@@ -15,7 +15,6 @@ from fairseq.data import (
NestedDictionaryDataset,
NumSamplesDataset,
NumelDataset,
OffsetTokensDataset,
PrependTokenDataset,
RawLabelDataset,
RightPadDataset,
......
......@@ -3,8 +3,6 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import torch
from fairseq import modules, utils
......
......@@ -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):
from fairseq import tokenizer
hypo_str = tgt_dict.string(hypo_tokens, remove_bpe)
if align_dict is not None:
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