Instructions to use laion/CLIP-convnext_base_w_320-laion_aesthetic-s13B-b82K-augreg with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- OpenCLIP
How to use laion/CLIP-convnext_base_w_320-laion_aesthetic-s13B-b82K-augreg with OpenCLIP:
import open_clip model, preprocess_train, preprocess_val = open_clip.create_model_and_transforms('hf-hub:laion/CLIP-convnext_base_w_320-laion_aesthetic-s13B-b82K-augreg') tokenizer = open_clip.get_tokenizer('hf-hub:laion/CLIP-convnext_base_w_320-laion_aesthetic-s13B-b82K-augreg') - Notebooks
- Google Colab
- Kaggle
How to read this model using transformers package?
How can I load this model in python using the transformer package?
I tried to use both AutoModel.from_pretrained and CLIPModel.from_pretrained. First it gave the following error.
*** OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.in
dex or flax_model.msgpack found in directory models/laion/CLIP-convnext_base_w_320-laion_aestheti
c-s13B-b82K-augreg.
So, I downloaded the model and renamed the files open_clip_model.safetensors and open_clip_pytorch_model.bin to pytorch_model.bin and model.safetensors, respectively.
Then, I can load the model, but loading is giving the following warning.
Some weights of ConvNextBackbone were not initialized from the model checkpoint at models/laion/C
LIP-convnext_base_w_320-laion_aesthetic-s13B-b82K-augreg and are newly initialized: ...
Where all the weights of the model are listed. So, this is only initializing a new model with newly initialized parameters.
Can you please share the steps how to load this pretrained model using transformers library?
please refer to the documentation located here:
https://huggingface.co/docs/hub/en/open_clip
Thank you! It worked.