add black to CI

This commit is contained in:
Pierre Chapuis 2023-08-29 17:53:39 +02:00
parent 08a5341452
commit 32c1cfdbb1
3 changed files with 8 additions and 2 deletions

View file

@ -24,6 +24,9 @@ jobs:
- name: poetry install - name: poetry install
run: poetry install --no-interaction --extras=training run: poetry install --no-interaction --extras=training
- name: black
run: poetry run black --check .
- name: lint - name: lint
run: poetry run ruff check . run: poetry run ruff check .

View file

@ -24,6 +24,7 @@ def test_weights_path() -> Path:
def test_e2e_path() -> Path: def test_e2e_path() -> Path:
return PARENT_PATH / "e2e" return PARENT_PATH / "e2e"
@fixture(scope="session") @fixture(scope="session")
def test_textual_inversion_path() -> Path: def test_textual_inversion_path() -> Path:
return PARENT_PATH / "foundationals" / "clip" / "test_concepts_ref" return PARENT_PATH / "foundationals" / "clip" / "test_concepts_ref"

View file

@ -41,7 +41,9 @@ def our_encoder_with_new_concepts(
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def ref_sd15_with_new_concepts(runwayml_weights_path: Path, test_textual_inversion_path: Path, test_device: torch.device): 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 = 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 / "cat-toy") # type: ignore
pipe.load_textual_inversion(test_textual_inversion_path / "gta5-artwork") # type: ignore pipe.load_textual_inversion(test_textual_inversion_path / "gta5-artwork") # type: ignore