Update app.py
Browse files
app.py
CHANGED
@@ -495,7 +495,7 @@ def get_query_embedding_together(query):
|
|
495 |
response.raise_for_status()
|
496 |
return response.json()["data"][0]["embedding"]
|
497 |
|
498 |
-
def find_most_similar_chunks(query_embedding, data, top_n=
|
499 |
query_vec = np.array(query_embedding).reshape(1, -1)
|
500 |
similarities = []
|
501 |
for item in data:
|
@@ -523,7 +523,6 @@ if query:
|
|
523 |
query_embedding = get_query_embedding_together(query)
|
524 |
data = load_embeddings(EMBEDDING_FILE)
|
525 |
top_chunks = find_most_similar_chunks(query_embedding, data, top_n=10)
|
526 |
-
st.write("Top Chunks:", top_chunks)
|
527 |
|
528 |
context = "\n".join(top_chunks)
|
529 |
prompt = f"""
|
|
|
495 |
response.raise_for_status()
|
496 |
return response.json()["data"][0]["embedding"]
|
497 |
|
498 |
+
def find_most_similar_chunks(query_embedding, data, top_n=10):
|
499 |
query_vec = np.array(query_embedding).reshape(1, -1)
|
500 |
similarities = []
|
501 |
for item in data:
|
|
|
523 |
query_embedding = get_query_embedding_together(query)
|
524 |
data = load_embeddings(EMBEDDING_FILE)
|
525 |
top_chunks = find_most_similar_chunks(query_embedding, data, top_n=10)
|
|
|
526 |
|
527 |
context = "\n".join(top_chunks)
|
528 |
prompt = f"""
|