From 32c1cfdbb1978d0881a30fd658b13f9aa7a0a53d Mon Sep 17 00:00:00 2001 From: Pierre Chapuis Date: Tue, 29 Aug 2023 17:53:39 +0200 Subject: [PATCH] add black to CI --- .github/workflows/ci.yml | 3 +++ tests/conftest.py | 1 + tests/foundationals/clip/test_concepts.py | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9f56dc..26d6f1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ jobs: - name: poetry install run: poetry install --no-interaction --extras=training + - name: black + run: poetry run black --check . + - name: lint run: poetry run ruff check . diff --git a/tests/conftest.py b/tests/conftest.py index cf7a28b..decf97f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -24,6 +24,7 @@ def test_weights_path() -> Path: def test_e2e_path() -> Path: return PARENT_PATH / "e2e" + @fixture(scope="session") def test_textual_inversion_path() -> Path: return PARENT_PATH / "foundationals" / "clip" / "test_concepts_ref" diff --git a/tests/foundationals/clip/test_concepts.py b/tests/foundationals/clip/test_concepts.py index 6df3e07..aed634d 100644 --- a/tests/foundationals/clip/test_concepts.py +++ b/tests/foundationals/clip/test_concepts.py @@ -41,8 +41,10 @@ def our_encoder_with_new_concepts( @pytest.fixture(scope="module") -def ref_sd15_with_new_concepts(runwayml_weights_path: Path, test_textual_inversion_path: Path, test_device: torch.device): - pipe = StableDiffusionPipeline.from_pretrained(runwayml_weights_path, torch_dtype=torch.float16).to(test_device) # type: ignore +def ref_sd15_with_new_concepts( + runwayml_weights_path: Path, test_textual_inversion_path: Path, test_device: torch.device +): + pipe = StableDiffusionPipeline.from_pretrained(runwayml_weights_path, torch_dtype=torch.float16).to(test_device) # type: ignore pipe.load_textual_inversion(test_textual_inversion_path / "cat-toy") # type: ignore pipe.load_textual_inversion(test_textual_inversion_path / "gta5-artwork") # type: ignore return pipe