ruff fixes

This commit is contained in:
Lincoln Stein 2024-06-03 20:33:31 -04:00 committed by psychedelicious
parent f81b8bc9f6
commit 9f9379682e
2 changed files with 3 additions and 0 deletions

View File

@ -57,11 +57,13 @@ def test_load_from_path(mock_context: InvocationContext, embedding_file: Path) -
assert isinstance(loaded_model_3.model, dict) assert isinstance(loaded_model_3.model, dict)
assert torch.equal(loaded_model_1.model["emb_params"], loaded_model_3.model["emb_params"]) assert torch.equal(loaded_model_1.model["emb_params"], loaded_model_3.model["emb_params"])
def test_load_from_dir(mock_context: InvocationContext, vae_directory: Path) -> None: def test_load_from_dir(mock_context: InvocationContext, vae_directory: Path) -> None:
loaded_model = mock_context.models.load_and_cache_model(vae_directory) loaded_model = mock_context.models.load_and_cache_model(vae_directory)
assert isinstance(loaded_model, LoadedModelWithoutConfig) assert isinstance(loaded_model, LoadedModelWithoutConfig)
assert isinstance(loaded_model.model, AutoencoderTiny) assert isinstance(loaded_model.model, AutoencoderTiny)
def test_download_and_load(mock_context: InvocationContext) -> None: def test_download_and_load(mock_context: InvocationContext) -> None:
loaded_model_1 = mock_context.models.load_and_cache_model( loaded_model_1 = mock_context.models.load_and_cache_model(
"https://www.test.foo/download/test_embedding.safetensors" "https://www.test.foo/download/test_embedding.safetensors"

View File

@ -60,6 +60,7 @@ def mm2_model_files(tmp_path_factory) -> Path:
def embedding_file(mm2_model_files: Path) -> Path: def embedding_file(mm2_model_files: Path) -> Path:
return mm2_model_files / "test_embedding.safetensors" return mm2_model_files / "test_embedding.safetensors"
@pytest.fixture @pytest.fixture
def vae_directory(mm2_model_files: Path) -> Path: def vae_directory(mm2_model_files: Path) -> Path:
return mm2_model_files / "taesdxl" return mm2_model_files / "taesdxl"