Update app.py
Browse files
app.py
CHANGED
@@ -101,8 +101,12 @@ def process_files(model_name, split_strategy, chunk_size, overlap_size, max_toke
|
|
101 |
|
102 |
def search_embeddings(query, model_name, top_k):
|
103 |
model = HuggingFaceEmbeddings(model_name=MODELS[model_name])
|
104 |
-
embeddings = model.embed_query(query)
|
105 |
-
|
|
|
|
|
|
|
|
|
106 |
# Perform FAISS or other similarity-based search over embeddings
|
107 |
# This part requires you to build and search a FAISS index with embeddings
|
108 |
|
|
|
101 |
|
102 |
def search_embeddings(query, model_name, top_k):
|
103 |
model = HuggingFaceEmbeddings(model_name=MODELS[model_name])
|
104 |
+
#embeddings = model.embed_query(query)
|
105 |
+
embeddings = model.similarity_search(query)
|
106 |
+
print(embeddings[0])
|
107 |
+
#query = "What did the president say about Ketanji Brown Jackson"
|
108 |
+
#docs = db.similarity_search(query)
|
109 |
+
#print(docs[0].page_content)
|
110 |
# Perform FAISS or other similarity-based search over embeddings
|
111 |
# This part requires you to build and search a FAISS index with embeddings
|
112 |
|