From 5f50117bf945c2a2d68ac2c6dc50e4977853deca Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Fri, 5 Jun 2026 20:08:43 +0100 Subject: [PATCH] docs(native-loader): document shape-mismatch override behavior --- pipelines/native_transformer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pipelines/native_transformer.py b/pipelines/native_transformer.py index 1961142f3..a8ebe0629 100644 --- a/pipelines/native_transformer.py +++ b/pipelines/native_transformer.py @@ -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. """