-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix to loading VLMs after transformers bump #1068
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
Conversation
@aymeric-roucher @albertvillanova tested with the RAG example and SmolLM and SmolVLM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The CI is red: some tests are not passing.
src/smolagents/models.py
Outdated
api = HfApi() | ||
pipeline_tag = api.model_info(model_id).pipeline_tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually use the functions from the root of the package, so we use a single API instance:
huggingface_hub.model_info
pushed a fix to handle models when a path is passed (and not necessarily loading from HF cache) |
@albertvillanova the mocked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@merveenoyan, some thoughts:
- It is true we did not consider is that
model_id
could be a local path, meaning the Hub-centricmodel_info
approach can't be used in that case. We may need a different way to handle this. - This logic might already be implemented somewhere in
transformers
, so we should check if we can reuse it instead of reimplementing it. - If all the logic becomes too complex, it might be worth extracting it into a dedicated method for better maintainability.
- Regarding the tests, we can address them once the implementation is finalized, so we clearly know what patches need to be added
thus this seems to be the most feasible way of doing it imo, I don't think it's too complex. |
@merveenoyan I think I may not have explained myself clearly. What I meant regarding local models (not on the Hub) is:
Let me know what you think! |
I agree that maybe some part from transformers could be reused. For example given a pipeline tag you can infer the auto_model from https://github.com/huggingface/transformers/blob/348f3285c5114159d2ff4933b4b8ae36866d01a7/utils/update_metadata.py#L63 Maybe that would make code more sustainable to changes 🤔 |
@albertvillanova for transformers, if a model card doesn't exist, |
closing this in favor of hotfix #1070 but would be better to get out of try except |
No description provided.