M17idd commited on
Commit
4adedca
·
verified ·
1 Parent(s): 366eecd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -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=10):
499
  query_vec = np.array(query_embedding).reshape(1, -1)
500
  similarities = []
501
  for item in data:
@@ -521,7 +521,7 @@ if query:
521
  try:
522
  query_embedding = get_query_embedding_together(query)
523
  data = load_embeddings(EMBEDDING_FILE)
524
- top_chunks = find_most_similar_chunks(query_embedding, data, top_n=10)
525
 
526
  context = "\n".join(top_chunks)
527
  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=20):
499
  query_vec = np.array(query_embedding).reshape(1, -1)
500
  similarities = []
501
  for item in data:
 
521
  try:
522
  query_embedding = get_query_embedding_together(query)
523
  data = load_embeddings(EMBEDDING_FILE)
524
+ top_chunks = find_most_similar_chunks(query_embedding, data, top_n=20)
525
 
526
  context = "\n".join(top_chunks)
527
  prompt = f"""