Instructions to use OFA-Sys/chinese-clip-vit-base-patch16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OFA-Sys/chinese-clip-vit-base-patch16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="OFA-Sys/chinese-clip-vit-base-patch16") 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("OFA-Sys/chinese-clip-vit-base-patch16") model = AutoModelForZeroShotImageClassification.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16") - Notebooks
- Google Colab
- Kaggle
使用该模型时跳出无法加载tokenizer的错误
#2
by IF-chan - opened
OSError: Can't load tokenizer for 'OFA-Sys/chinese-clip-vit-base-patch16'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'OFA-Sys/chinese-clip-vit-base-patch16' is the correct path to a directory containing all relevant files for a CLIPTokenizerFast tokenizer.
model = ChineseCLIPModel.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")
processor = ChineseCLIPProcessor.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")
兄弟我也遇到这个问题了,你换这个加载模型