Skip to content

Commit ed22b4f

Browse files
authored
Revive make quality (huggingface#203)
* Revive Make utils * Add datasets for training too
1 parent f9522d8 commit ed22b4f

16 files changed

Lines changed: 27 additions & 140 deletions

File tree

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ test:
7979
test-examples:
8080
python -m pytest -n auto --dist=loadfile -s -v ./examples/pytorch/
8181

82-
# Run tests for SageMaker DLC release
83-
84-
test-sagemaker: # install sagemaker dependencies in advance with pip install .[sagemaker]
85-
TEST_SAGEMAKER=True python -m pytest -n auto -s -v ./tests/sagemaker
86-
8782

8883
# Release stuff
8984

setup.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,22 @@
7777
# 2. once modified, run: `make deps_table_update` to update src/diffusers/dependency_versions_table.py
7878
_deps = [
7979
"Pillow",
80+
"accelerate>=0.11.0",
8081
"black~=22.0,>=22.3",
82+
"datasets",
8183
"filelock",
8284
"flake8>=3.8.3",
85+
"hf-doc-builder>=0.3.0",
8386
"huggingface-hub",
8487
"importlib_metadata",
8588
"isort>=5.5.4",
89+
"modelcards==0.1.4",
8690
"numpy",
8791
"pytest",
8892
"regex!=2019.12.17",
8993
"requests",
90-
"torch>=1.4",
9194
"tensorboard",
92-
"modelcards==0.1.4"
95+
"torch>=1.4",
9396
]
9497

9598
# this is a lookup table with items like:
@@ -161,12 +164,10 @@ def run(self):
161164

162165
extras = {}
163166
extras["quality"] = ["black ~= 22.0", "isort >= 5.5.4", "flake8 >= 3.8.3"]
164-
extras["docs"] = []
165-
extras["training"] = ["tensorboard", "modelcards"]
166-
extras["test"] = [
167-
"pytest",
168-
]
169-
extras["dev"] = extras["quality"] + extras["test"] + extras["training"]
167+
extras["docs"] = ["hf-doc-builder"]
168+
extras["training"] = ["accelerate", "datasets", "tensorboard", "modelcards"]
169+
extras["test"] = ["pytest"]
170+
extras["dev"] = extras["quality"] + extras["test"] + extras["training"] + extras["docs"]
170171

171172
install_requires = [
172173
deps["importlib_metadata"],

src/diffusers/dependency_versions_table.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
# 2. run `make deps_table_update``
44
deps = {
55
"Pillow": "Pillow",
6+
"accelerate": "accelerate>=0.11.0",
67
"black": "black~=22.0,>=22.3",
78
"filelock": "filelock",
89
"flake8": "flake8>=3.8.3",
10+
"hf-doc-builder": "hf-doc-builder>=0.3.0",
911
"huggingface-hub": "huggingface-hub",
1012
"importlib_metadata": "importlib_metadata",
1113
"isort": "isort>=5.5.4",
14+
"modelcards": "modelcards==0.1.4",
1215
"numpy": "numpy",
1316
"pytest": "pytest",
1417
"regex": "regex!=2019.12.17",
1518
"requests": "requests",
1619
"torch": "torch>=1.4",
1720
"tensorboard": "tensorboard",
18-
"modelcards": "modelcards==0.1.4",
1921
}

src/diffusers/optimization.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from enum import Enum
1919
from typing import Optional, Union
2020

21-
import torch
2221
from torch.optim import Optimizer
2322
from torch.optim.lr_scheduler import LambdaLR
2423

src/diffusers/pipelines/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
from ..utils import is_inflect_available, is_transformers_available, is_unidecode_available
1+
# flake8: noqa
2+
# There's no way to ignore "F401 '...' imported but unused" warnings in this
3+
# module, but to preserve other warnings. So, don't check this module at all.
4+
5+
from ..utils import is_transformers_available
26
from .ddim import DDIMPipeline
37
from .ddpm import DDPMPipeline
48
from .latent_diffusion_uncond import LDMPipeline
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# flake8: noqa
12
from .pipeline_ddim import DDIMPipeline
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# flake8: noqa
12
from .pipeline_ddpm import DDPMPipeline

src/diffusers/pipelines/latent_diffusion/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# flake8: noqa
12
from ...utils import is_transformers_available
23

34

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# flake8: noqa
12
from .pipeline_latent_diffusion_uncond import LDMPipeline
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# flake8: noqa
12
from .pipeline_pndm import PNDMPipeline

0 commit comments

Comments
 (0)