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
run: poetry install --no-interaction --extras=training
- name: black
run: poetry run black --check .
- name: lint
run: poetry run ruff check .

View file

@ -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"

View file

@ -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