Skip to content

Commit af41dc8

Browse files
jazzhaikupsychedelicious
authored andcommitted
Make ruff happy
1 parent a17e771 commit af41dc8

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

invokeai/app/services/model_install/model_install_default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
AnyModelConfig,
3939
CheckpointConfigBase,
4040
InvalidModelConfigException,
41+
ModelConfigBase,
4142
)
4243
from invokeai.backend.model_manager.legacy_probe import ModelProbe
43-
from invokeai.backend.model_manager.config import ModelConfigBase
4444
from invokeai.backend.model_manager.metadata import (
4545
AnyModelRepoMetadata,
4646
HuggingFaceMetadataFetch,

invokeai/backend/model_manager/config.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,7 @@ def all_config_classes():
164164
return concrete
165165

166166
@staticmethod
167-
def classify(
168-
mod: str | Path | ModelOnDisk,
169-
hash_algo: HASHING_ALGORITHMS = "blake3_single",
170-
**overrides
171-
):
167+
def classify(mod: str | Path | ModelOnDisk, hash_algo: HASHING_ALGORITHMS = "blake3_single", **overrides):
172168
"""
173169
Returns the best matching ModelConfig instance from a model's file/folder path.
174170
Raises InvalidModelConfigException if no valid configuration is found.

scripts/classify-model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def classify_with_fallback(path: Path, hash_algo: HASHING_ALGORITHMS):
3232
except InvalidModelConfigException:
3333
return ModelConfigBase.classify(path, hash_algo)
3434

35+
3536
for path in args.model_path:
3637
try:
3738
config = classify_with_fallback(path, args.hash_algo)

tests/test_model_probe.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,10 @@ def test_any_model_config_includes_all_config_classes():
261261

262262

263263
def test_config_uniquely_matches_model(datadir: Path):
264-
265264
model_paths = ModelSearch().search(datadir / "stripped_models")
266265
for path in model_paths:
267-
268266
mod = StrippedModelOnDisk(path)
269-
matches = { cls for cls in ModelConfigBase.USING_CLASSIFY_API if cls.matches(mod) }
267+
matches = {cls for cls in ModelConfigBase.USING_CLASSIFY_API if cls.matches(mod)}
270268
assert len(matches) <= 1, f"Model at path {path} matches multiple config classes: {matches}"
271269
if not matches:
272270
logger.warning(f"Model at path {path} does not match any config classes using classify API.")
273-

0 commit comments

Comments
 (0)