testing dynamic register

This commit is contained in:
Chranos
2026-02-05 18:57:04 +08:00
parent ac2082ff36
commit d31ace279b
2 changed files with 64 additions and 9 deletions

View File

@@ -447,12 +447,18 @@ class _ModelRegistry:
warn_on_fail=True,
)
if model_cls is not None:
logger.info(
"Found custom model class %s from auto_map[%s], "
"using TransformersForCausalLM wrapper",
model_cls.__name__,
name
)
# Only log once per model class to avoid spam
log_key = f"{model_cls.__name__}_{name}"
if not hasattr(self, '_logged_custom_models'):
self._logged_custom_models = set()
if log_key not in self._logged_custom_models:
logger.info(
"Found custom model class %s from auto_map[%s], "
"using TransformersForCausalLM wrapper",
model_cls.__name__,
name
)
self._logged_custom_models.add(log_key)
# Return the wrapper architecture, not the actual class
return "TransformersForCausalLM"