Unverified Commit 9618cd69 authored by Doug Blank's avatar Doug Blank Committed by GitHub
Browse files

Import integration libraries first (#7650)

* Import intergration libraries first

* isort and black happiness

* flake8 happiness

* Add a test

* Black reformat

* Ignore import order in tests

* A heavy-handed method of disabling comet for tests

* Remove comet_ml tests

* Run black on setup.py
parent 4dcc424d
...@@ -134,9 +134,7 @@ setup( ...@@ -134,9 +134,7 @@ setup(
"sacremoses", "sacremoses",
], ],
extras_require=extras, extras_require=extras,
entry_points={ entry_points={"console_scripts": ["transformers-cli=transformers.commands.transformers_cli:main"]},
"console_scripts": ["transformers-cli=transformers.commands.transformers_cli:main"]
},
python_requires=">=3.6.0", python_requires=">=3.6.0",
classifiers=[ classifiers=[
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
......
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
import math import math
import os import os
from .file_utils import is_torch_tpu_available
from .trainer_callback import TrainerCallback
from .trainer_utils import PREFIX_CHECKPOINT_DIR, BestRun
from .utils import logging
# Import 3rd-party integrations first:
try: try:
# Comet needs to be imported before any ML frameworks
import comet_ml # noqa: F401 import comet_ml # noqa: F401
_has_comet = True _has_comet = True
...@@ -53,6 +51,14 @@ except ImportError: ...@@ -53,6 +51,14 @@ except ImportError:
except ImportError: except ImportError:
_has_tensorboard = False _has_tensorboard = False
# No transformer imports above this point
from .file_utils import is_torch_tpu_available
from .trainer_callback import TrainerCallback
from .trainer_utils import PREFIX_CHECKPOINT_DIR, BestRun
from .utils import logging
logger = logging.get_logger(__name__) logger = logging.get_logger(__name__)
......
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