Skip to content

Commit 65e7b53

Browse files
tests: monkeypatch secondary reference to gguf_sd_loader()
`gguf_sd_loader()` has multiple references in the codebase. It is imported before monkeypatching, so we need to monkeypatch another reference to it. This fixes tests for `ModelOnDisk.load_state_dict()`.
1 parent 814406d commit 65e7b53

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def override_model_loading(monkeypatch):
9494
monkeypatch.setattr(safetensors.torch, "load", load_stripped_model)
9595
monkeypatch.setattr(safetensors.torch, "load_file", load_stripped_model)
9696
monkeypatch.setattr(gguf_loaders, "gguf_sd_loader", load_stripped_model)
97+
monkeypatch.setattr("invokeai.backend.model_manager.config.gguf_sd_loader", load_stripped_model)
9798

9899
def fake_scan(*args, **kwargs):
99100
return SimpleNamespace(infected_files=0, scan_err=None)

0 commit comments

Comments
 (0)