Chris4K commited on
Commit
e6d71ec
·
verified ·
1 Parent(s): c09985f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -274,8 +274,9 @@ def calculate_statistics(results, search_time, vector_store, num_tokens, embeddi
274
  stats = {
275
  "num_results": len(results),
276
  # "avg_content_length": sum(len(doc.page_content) for doc in results) / len(results) if results else 0,
 
277
 
278
- "avg_content_length": np.mean([len(doc.page_content) for doc in results]) if not results.empty else 0,
279
  "search_time": search_time,
280
  "vector_store_size": vector_store._index.ntotal if hasattr(vector_store, '_index') else "N/A",
281
  "num_documents": len(vector_store.docstore._dict),
 
274
  stats = {
275
  "num_results": len(results),
276
  # "avg_content_length": sum(len(doc.page_content) for doc in results) / len(results) if results else 0,
277
+ "avg_content_length": np.mean([len(doc.page_content) for doc in results]) if results else 0,
278
 
279
+ #"avg_content_length": np.mean([len(doc.page_content) for doc in results]) if not results.empty else 0,
280
  "search_time": search_time,
281
  "vector_store_size": vector_store._index.ntotal if hasattr(vector_store, '_index') else "N/A",
282
  "num_documents": len(vector_store.docstore._dict),