mirror of
https://github.com/facebookresearch/fairseq.git
synced 2024-10-03 20:28:26 +03:00
Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/3104 Reviewed By: alexeib Differential Revision: D25786013 Pulled By: myleott fbshipit-source-id: 894b104f275573ce824d7f2318d043516f0e0c5c
This commit is contained in:
parent
7e5e45b483
commit
540fb42c52
15
hubconf.py
15
hubconf.py
@ -2,16 +2,11 @@
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
"""isort:skip_file"""
|
||||
|
||||
import functools
|
||||
import importlib
|
||||
|
||||
from fairseq.hub_utils import ( # noqa; noqa
|
||||
BPEHubInterface as bpe,
|
||||
TokenizerHubInterface as tokenizer,
|
||||
)
|
||||
from fairseq.models import MODEL_REGISTRY # noqa
|
||||
|
||||
|
||||
dependencies = [
|
||||
"dataclasses",
|
||||
@ -40,6 +35,14 @@ if len(missing_deps) > 0:
|
||||
raise RuntimeError("Missing dependencies: {}".format(", ".join(missing_deps)))
|
||||
|
||||
|
||||
# only do fairseq imports after checking for dependencies
|
||||
from fairseq.hub_utils import ( # noqa; noqa
|
||||
BPEHubInterface as bpe,
|
||||
TokenizerHubInterface as tokenizer,
|
||||
)
|
||||
from fairseq.models import MODEL_REGISTRY # noqa
|
||||
|
||||
|
||||
# torch.hub doesn't build Cython components, so if they are not found then try
|
||||
# to build them here
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user