diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index cef886e9a4..e4782b457b 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -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))