Spaces:
Running
Running
Commit
•
1bd0451
1
Parent(s):
8d613df
Update app.py
Browse files
app.py
CHANGED
@@ -43,8 +43,8 @@ zip_file = zipfile.ZipFile(zip_path)
|
|
43 |
|
44 |
# text_model = CLIPTextModelWithProjection.from_pretrained("openai/clip-vit-base-patch32")
|
45 |
# text_tokenizer = AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32")
|
46 |
-
|
47 |
-
|
48 |
|
49 |
def T2Isearch(query, k=50):
|
50 |
# Encode the text query
|
|
|
43 |
|
44 |
# text_model = CLIPTextModelWithProjection.from_pretrained("openai/clip-vit-base-patch32")
|
45 |
# text_tokenizer = AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32")
|
46 |
+
text_index = faiss.index_factory(vectors.shape[1], "Flat", faiss.METRIC_INNER_PRODUCT)
|
47 |
+
faiss.read_index("text_index.index")
|
48 |
|
49 |
def T2Isearch(query, k=50):
|
50 |
# Encode the text query
|