Add the option to select the openclip model #284
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are quite a few openclip models, but I need specifically laion/CLIP-ViT-L-14-DataComp.XL-s13B-b90K
I looked at the load_model function, it parses the
--clip_mode
l argument, and if the string starts withopen_clip:
, then using theload_open_clip
function, which actually loads the openclip modelThat's all great, but then I would expect to see some sort of parsing line after
open_clip:
, like, after for exampleViT-L-14
, there should be a specification of which model I want to download.But instead, I saw this.
So, the user is downloaded to the computer a random model that the user has no idea about, and he doesn't even have the ability to choose the model that he wants.
And you can see the wide variety of models that the open_clip library offers:
I propose a commit
So you can choose a model by typing
clip-retrieval inference --clip_model "open_clip:ViT-L-14 | datacomp_xl_s13b_b90k" ...
And even if you don't set the checkpoint after "|", you'll get a line about the model
print(f"Loading OpenClip model{model} with {checkpoint} checkpoint")