Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some type check in create_model #268

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

RaulPPelaez
Copy link
Collaborator

When load_model or create_model are called explicitly there is no mechanism to enforce types of the arguments like it happens when train.py is used (via arg parse).

This means that something like:

model = load_model(..., cutoff_upper=5)

fails because cutoff_upper should be a float but it is passed down as an integer.

This PR casts to float when necessary to avoid this.

Closes #267

@RaulPPelaez
Copy link
Collaborator Author

@guillemsimeon review pls

Copy link
Collaborator

@guillemsimeon guillemsimeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@RaulPPelaez RaulPPelaez merged commit 9619008 into torchmd:main Jan 31, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception reloading model
2 participants