Instructions to use openai/clip-vit-large-patch14 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openai/clip-vit-large-patch14 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") 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") model = AutoModelForZeroShotImageClassification.from_pretrained("openai/clip-vit-large-patch14") - Notebooks
- Google Colab
- Kaggle
OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it...
OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like openai/clip-vit-large-patch14 is not the path to a directory containing a file named config.json.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
Thank you for your open source work.
According to the description, the problem is that config.json cannot be found. But the library does have this file. In addition, I tried to load it offline according to the prompt, but even if I added that parameter, this problem still occurred.
have you figured it out, I'm having the same issue
I forgot how I solved it, but I always downloaded the model locally and used the absolute path in the code to load the model, and I never encountered this error. If you are in China, you can use hf-mirror to download the model, otherwise you can just use huggingface's tool to download it.