Update _utils.py

This commit is contained in:
Daniel Han 2025-05-04 03:03:50 -07:00
commit 08afb5001e

View file

@ -256,7 +256,10 @@ for model_name in model_architectures:
config_filepath = f"transformers.models.{model_name}.configuration_{model_name}"
model_filepath = f"transformers.models.{model_name}.modeling_{model_name}"
config_filename = f"{model_name.title().replace('_','')}Config" # qwen3 arch folder is qwen3_moe but config is Qwen3Config. Need to remove underscore(_) for now
exec(f"from {config_filepath} import {config_filename}", globals())
try:
exec(f"from {config_filepath} import {config_filename}", globals())
except:
continue
try:
config = inspect.getsource(eval(config_filename))