Instructions to use mlx-community/clip-vit-large-patch14 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/clip-vit-large-patch14 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download mlx-community/clip-vit-large-patch14 --local-dir clip-vit-large-patch14
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
|
Download README.md from mlx-community/clip-vit-large-patch14: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/mlx-community/clip-vit-large-patch14/resolve/main/README.md
- Command line
-
hf download hf://mlx-community/clip-vit-large-patch14/README.md
-
curl -L -o README.md https://huggingface.co/mlx-community/clip-vit-large-patch14/resolve/main/README.md
1.14 kB
| license: apache-2.0 | |
| library_name: mlx | |
| # mlx-community/clip-vit-large-patch14 | |
| This model was converted to MLX format from [`clip-vit-large-patch14`](https://huggingface.co/clip-vit-large-patch14). | |
| Refer to the [original model card](https://huggingface.co/openai/clip-vit-large-patch14) for more details on the model. | |
| ## Use with mlx-examples | |
| Download the repository 👇 | |
| ``` | |
| pip install huggingface_hub hf_transfer | |
| export HF_HUB_ENABLE_HF_TRANSFER=1 | |
| huggingface-cli download --local-dir <LOCAL FOLDER PATH> mlx-community/clip-vit-large-patch14 | |
| ``` | |
| Install `mlx-examples`. | |
| ```bash | |
| git clone git@github.com:ml-explore/mlx-examples.git | |
| cd clip | |
| pip install -r requirements.txt | |
| ``` | |
| Run the model. | |
| ```python | |
| from PIL import Image | |
| import clip | |
| model, tokenizer, img_processor = clip.load("mlx_model") | |
| inputs = { | |
| "input_ids": tokenizer(["a photo of a cat", "a photo of a dog"]), | |
| "pixel_values": img_processor( | |
| [Image.open("assets/cat.jpeg"), Image.open("assets/dog.jpeg")] | |
| ), | |
| } | |
| output = model(**inputs) | |
| # Get text and image embeddings: | |
| text_embeds = output.text_embeds | |
| image_embeds = output.image_embeds | |
| ``` |