Instructions to use apple/DFN-public with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use apple/DFN-public with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="apple/DFN-public") pipe( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png", candidate_labels=["animals", "humans", "landscape"], )# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForZeroShotImageClassification processor = AutoProcessor.from_pretrained("apple/DFN-public") model = AutoModelForZeroShotImageClassification.from_pretrained("apple/DFN-public", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download vocab.json from apple/DFN-public: direct link, hf CLI and curl.
- Browser
- Download file 862 kB
-
https://huggingface.co/apple/DFN-public/resolve/main/vocab.json
- Command line
-
hf download hf://apple/DFN-public/vocab.json
-
curl -L -o vocab.json https://huggingface.co/apple/DFN-public/resolve/main/vocab.json
862 kB
File too large to display, you can check the raw version instead.