Upload app_federal.py
Browse files- app_federal.py +2 -2
app_federal.py
CHANGED
@@ -230,7 +230,7 @@ def rerank_with_chatGPT(query, search_results):
|
|
230 |
Return a python list with the ids of the five highest ranking results, nothing else.
|
231 |
<query>""" + query + "</query>\n\n"
|
232 |
user_prompt = []
|
233 |
-
for i in search_results[:
|
234 |
user_prompt.append(format_metadata_for_reranking(i["metadata_reranking"], i["text"], i["index"]))
|
235 |
user_prompt = "\n".join(user_prompt)
|
236 |
out = text_prompt_call("gpt-4o", system_prompt, user_prompt)
|
@@ -254,7 +254,7 @@ def run_retrieval(query):
|
|
254 |
|
255 |
query_embeddings = run_dense_retrieval(query)
|
256 |
query_embeddings = pca_model.transform(query_embeddings)
|
257 |
-
D, I = faiss_index.search(query_embeddings,
|
258 |
scores_embeddings = D[0]
|
259 |
indices_embeddings = I[0]
|
260 |
indices_embeddings = [int(i) for i in indices_embeddings]
|
|
|
230 |
Return a python list with the ids of the five highest ranking results, nothing else.
|
231 |
<query>""" + query + "</query>\n\n"
|
232 |
user_prompt = []
|
233 |
+
for i in search_results[:20]:
|
234 |
user_prompt.append(format_metadata_for_reranking(i["metadata_reranking"], i["text"], i["index"]))
|
235 |
user_prompt = "\n".join(user_prompt)
|
236 |
out = text_prompt_call("gpt-4o", system_prompt, user_prompt)
|
|
|
254 |
|
255 |
query_embeddings = run_dense_retrieval(query)
|
256 |
query_embeddings = pca_model.transform(query_embeddings)
|
257 |
+
D, I = faiss_index.search(query_embeddings, 20)
|
258 |
scores_embeddings = D[0]
|
259 |
indices_embeddings = I[0]
|
260 |
indices_embeddings = [int(i) for i in indices_embeddings]
|