Skip to content

Commit af38885

Browse files
committed
chore: Handle ImportError when importing models
Handle the ImportError exception when importing models in the lmms_eval package. This change adds a try-except block to catch the ImportError and print an error message indicating the failed import. This will help with troubleshooting and identifying any issues with the model imports.
1 parent f513c52 commit af38885

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: lmms_eval/models/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@
3434
for model_name, model_class in AVAILABLE_MODELS.items():
3535
try:
3636
exec(f"from .{model_name} import {model_class}")
37-
except ImportError:
37+
except ImportError as e:
38+
print(f"Failed to import {model_class} from {model_name}: {e}")
3839
pass

0 commit comments

Comments
 (0)