Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Tests: stub _unmerge_flags_on_error in the merged hub destination harness (#14961)

Daniel Han6875840a96a2
diff --git a/tests/saving/test_save_method_lora_routing.py b/tests/saving/test_save_method_lora_routing.py
index 985c8388088..1571ed2756e 100644
--- a/tests/saving/test_save_method_lora_routing.py
+++ b/tests/saving/test_save_method_lora_routing.py
@@ -39,6 +39,8 @@ def _load(*names, **env):
namespace = {
"raise_if_merging_mistral_format_view": lambda model, save_method: None,
"lora_relative_to_original_base": lambda model: contextlib.nullcontext(),
+ # Unmerges FSDP2 streamed layers when a save raises; these fixtures never stream.
+ "_unmerge_flags_on_error": lambda streamed: contextlib.nullcontext(),
"nullcontext": contextlib.nullcontext,
# Full saves add bare Params4bit quant state (fused 4-bit experts); none in these fixtures.
"PeftModel": type("PeftModel", (), {}),
@@ -216,6 +218,7 @@ _GENERIC_SAVE_STUBBED_HELPERS = frozenset(
"_internal_mtp_save",
"_stitch_mtp_head",
"_mtp_head_tensor_names",
+ "_unmerge_flags_on_error",
}
)
diff --git a/tests/test_merged_hub_destination.py b/tests/test_merged_hub_destination.py
index 9081ab2db53..56ef55cfb66 100644
--- a/tests/test_merged_hub_destination.py
+++ b/tests/test_merged_hub_destination.py
@@ -175,6 +175,7 @@ def saving(monkeypatch, tmp_path):
_mtp_head_tensor_names = lambda model: [],
raise_if_merging_mistral_format_view = lambda model, save_method: None,
lora_relative_to_original_base = lambda model: contextlib.nullcontext(),
+ _unmerge_flags_on_error = lambda streamed: contextlib.nullcontext(),
nullcontext = contextlib.nullcontext,
logger = SimpleNamespace(warning_once = lambda *args: None),
# save_method="lora" hands off to the adapter save; record the handover.