karthikvarunn commited on
Commit
f7ca5e4
·
verified ·
1 Parent(s): 2247b0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -62,7 +62,7 @@ def search_documents(query):
62
  unique_results = []
63
  for result in results:
64
  unique_id = result.metadata.get("id")
65
- if unique_id and unique_id not in seen_ids:
66
  seen_ids.add(unique_id)
67
  unique_results.append(result)
68
 
@@ -78,7 +78,7 @@ def search_documents(query):
78
  "score": result.metadata.get("score", 0.0), # Score might not be available in all libraries
79
  })
80
 
81
- # Combine the relevant text for additional processing, if needed
82
  combined_context = "\n\n".join([res["relevant_text"] for res in context])
83
  return context, combined_context
84
  except Exception as e:
 
62
  unique_results = []
63
  for result in results:
64
  unique_id = result.metadata.get("id")
65
+ if unique_id not in seen_ids:
66
  seen_ids.add(unique_id)
67
  unique_results.append(result)
68
 
 
78
  "score": result.metadata.get("score", 0.0), # Score might not be available in all libraries
79
  })
80
 
81
+ # Combine the relevant text for additional processing
82
  combined_context = "\n\n".join([res["relevant_text"] for res in context])
83
  return context, combined_context
84
  except Exception as e: