Instructions to use openai/clip-vit-large-patch14-336 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openai/clip-vit-large-patch14-336 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="openai/clip-vit-large-patch14-336") pipe( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png", candidate_labels=["animals", "humans", "landscape"], )# Load model directly from transformers import AutoProcessor, AutoModelForZeroShotImageClassification processor = AutoProcessor.from_pretrained("openai/clip-vit-large-patch14-336") model = AutoModelForZeroShotImageClassification.from_pretrained("openai/clip-vit-large-patch14-336") - Notebooks
- Google Colab
- Kaggle
Can anyone upload a Tensorflow version, thanks
Urgently need tensorflow version
Hi there! Even though there isn't a TF checkpoint up here, you should be able to load and convert the model in TensorFlow with the following
from transformers import TFCLIPModel
model = TFCLIPModel.from_pretrained("openai/clip-vit-large-patch14-336", from_pt=True)
And then you should be able to save the weights with model.save_pretrained('weights-folder') or even push it to the hub anywhere you'd like.
There's also transformers-cli pt-to-tf --model-name <your clip model hub name> which should also work, and it does a bunch of checks on top. I think it'll also open a PR on the hub here if the checks pass.
I'll create a TF version for you in the meantime as well!
Update – I did the conversion and uploaded the TF version, so you can load with without needing to including from_pt=True. Let me know if there's anything else I can help with, otherwise I'll close this discussion in a day or two 😊
Update – I did the conversion and uploaded the TF version, so you can load with without needing to including
from_pt=True. Let me know if there's anything else I can help with, otherwise I'll close this discussion in a day or two 😊
Thank you for sharing the tf version, your submission is a great help to my research!