Fix flake8 F401 imported but unused (#317)

* Fix flake8 F401 '...' imported but unused

* One more F403
This commit is contained in:
Anton Lozhkov 2022-09-01 14:56:25 +02:00 committed by GitHub
parent 2fa4476525
commit 3c138a4d2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 4 additions and 22 deletions

View File

@ -17,3 +17,4 @@ use_parentheses = True
[flake8]
ignore = E203, E722, E501, E741, W503, W605
max-line-length = 119
per-file-ignores = __init__.py:F401

View File

@ -1,6 +1,3 @@
# flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
from .utils import is_inflect_available, is_scipy_available, is_transformers_available, is_unidecode_available
@ -32,7 +29,7 @@ from .schedulers import (
if is_scipy_available():
from .schedulers import LMSDiscreteScheduler
else:
from .utils.dummy_scipy_objects import *
from .utils.dummy_scipy_objects import * # noqa F403
from .training_utils import EMAModel
@ -45,4 +42,4 @@ if is_transformers_available():
StableDiffusionPipeline,
)
else:
from .utils.dummy_transformers_objects import *
from .utils.dummy_transformers_objects import * # noqa F403

View File

@ -1,7 +1,3 @@
# flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,7 +1,3 @@
# flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
from ..utils import is_transformers_available
from .ddim import DDIMPipeline
from .ddpm import DDPMPipeline

View File

@ -1,7 +1,3 @@
# flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -29,4 +25,4 @@ from .scheduling_utils import SchedulerMixin
if is_scipy_available():
from .scheduling_lms_discrete import LMSDiscreteScheduler
else:
from ..utils.dummy_scipy_objects import *
from ..utils.dummy_scipy_objects import * # noqa F403

View File

@ -1,7 +1,3 @@
# flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");