-
Notifications
You must be signed in to change notification settings - Fork 9
Make it possible to load siglip models from local files #22
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
base: main
Are you sure you want to change the base?
Conversation
- read img and patch size if supplied in model_config arg
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.
not sure if you want to pin this to some version, just thought I'd add it since I can't run the repo without torch installed
Hey @maxlund Thanks for the PR! The context is that for certain models they don't supply the patch and img size on the Besides torch, which I will address today. Are you having trouble with any Siglip model in particular? |
Hey no problem, messing around with it now and running into some issues. This seems to work fine and gives me embeddings for both text and images. But I want to extract them in separate steps of my pipeline.
This:
gives me:
get_text_features and get_image_features using
but ran into other issues.. |
Okay some progress..
|
|
Okay this did the trick I think
Might be able to get some benchmarks soon if no other road bumps |
Read img and patch size if supplied in model_config arg.
What is the context for the regex parsing of the repo name, the img/patch size isn't always correct in the
config.json
file I guess? Anyway this small change makes it possible to load a local model while being offline:FWIW the image and patch size seemed to be correct for both
mlx-community/siglip-large-patch16-384
andmlx-community/siglip-so400m-patch14-384
via downloadedconfig.json
in the hf repos