Views
No views yet
1from transformers import CLIPModel, CLIPProcessor
2from huggingface_hub import hf_hub_download
3import faiss
4import json
5
6# Load model
7model = CLIPModel.from_pretrained("multimodal-face-clip", subfolder=".")
8processor = CLIPProcessor.from_pretrained("multimodal-face-clip", subfolder=".")
9
10# Load embeddings (optional)
11text_index_path = hf_hub_download(repo_id="multimodal-face-clip", filename="embeddings/text_index.faiss")
12image_index_path = hf_hub_download(repo_id="multimodal-face-clip", filename="embeddings/image_index.faiss")