Fix ruff linter (#137)

* Fix ruff linter

* Remove unused imports

* Remove unused imports
This commit is contained in:
Chenlei Hu
2024-02-09 01:35:20 +00:00
committed by GitHub
parent 66c22490c3
commit 6b3ad64388
18 changed files with 25 additions and 39 deletions

View File

@@ -34,7 +34,7 @@ def try_load_supported_control_model(ckpt_path):
global supported_control_models
state_dict = ldm_patched.modules.utils.load_torch_file(ckpt_path, safe_load=True)
for supported_type in supported_control_models:
state_dict_copy = {k: v for k, v in state_dict.items()}
state_dict_copy = dict(state_dict)
model = supported_type.try_build_from_state_dict(state_dict_copy, ckpt_path)
if model is not None:
return model