Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

test(flux2): let the int8 fixture drive either fp8 keep decision

Alexander Eichhorn9cdd11e4a084
diff --git a/tests/backend/model_manager/load/test_flux2_int8_convrot_loader.py b/tests/backend/model_manager/load/test_flux2_int8_convrot_loader.py
index 78417d89b8..b8c7323ef8 100644
--- a/tests/backend/model_manager/load/test_flux2_int8_convrot_loader.py
+++ b/tests/backend/model_manager/load/test_flux2_int8_convrot_loader.py
@@ -148,7 +148,12 @@ def _driver(monkeypatch, tmp_path, state_dict: dict, trace: dict | None = None,
loader._torch_dtype = torch.bfloat16
monkeypatch.setattr(module, "load_file", lambda _path: state_dict)
- monkeypatch.setattr(module, "should_keep_fp8_weights", lambda _device: False)
+ # Both spellings of the same decision: the module-level helper, and the loader method that
+ # supersedes it once FP8 Storage counts as a consumer too. Setting both keeps this fixture
+ # working either way -- an instance attribute shadows the method when it exists, and
+ # `raising=False` tolerates the module symbol being gone.
+ monkeypatch.setattr(module, "should_keep_fp8_weights", lambda _device: False, raising=False)
+ loader._keep_fp8_weights = lambda _config, _submodel=None: False
monkeypatch.setattr(module, "read_safetensors_metadata", lambda _path, _logger: header)
return loader, config