M17idd commited on
Commit
6304397
·
verified ·
1 Parent(s): 8c4a81d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
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=3):
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"""