docs(native-loader): document shape-mismatch override behavior

This commit is contained in:
CalamitousFelicitousness
2026-06-05 20:08:43 +01:00
parent 32081ade7c
commit 5f50117bf9
+5 -2
View File
@@ -63,13 +63,16 @@ DEFAULT_ACCEPTABLE_MISSING: tuple[str, ...] = (
class OverrideArchMismatch(Exception):
"""Raised when a user-selected UNET/DiT override cannot be loaded as the
spec's transformer class: the arch-specific converter rejects its keys, or
``load_state_dict`` reports a structural mismatch (unexpected or missing
required keys).
``load_state_dict`` reports unexpected or missing keys.
:func:`pipelines.generic_transformer.load_transformer` catches this to drop
the override and load the base repo transformer instead, so a stale or
wrong-arch UNET selection degrades to the base model rather than crashing
inside a converter.
A tensor shape mismatch on otherwise-matching keys is not raised as this; it
surfaces as the native ``load_state_dict`` error, which already names the
conflicting shapes, so it stays a hard load error rather than a fall back.
"""