[diffusion] chore: minor code cleanups (#15190)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Mick
2025-12-15 23:57:02 +08:00
committed by GitHub
parent 7bc8b1532e
commit 1dedb63860
12 changed files with 85 additions and 127 deletions

View File

@@ -128,11 +128,16 @@ class ComponentLoader(ABC):
component_model_path, server_args, module_name
)
source = "customized"
except Exception as _e:
traceback.print_exc()
logger.error(
f"Error while loading customized {module_name}, falling back to native version"
)
except Exception as e:
if "Unsupported model architecture" in str(e):
logger.info(
f"Module: {module_name} doesn't have a customized version yet, using native version"
)
else:
traceback.print_exc()
logger.error(
f"Error while loading customized {module_name}, falling back to native version"
)
# fallback to native version
component = self.load_native(
component_model_path, server_args, transformers_or_diffusers