Ritesh-hf commited on
Commit
f1dbcbc
·
verified ·
1 Parent(s): c0f082d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -223,8 +223,8 @@ async def websocket_endpoint(websocket: WebSocket):
223
  if (index+1) in citation_numbers:
224
  sources[f"[{index+1}]"] = doc.metadata["source"]
225
  else:
226
- if i <= 5:
227
- backup[str(i)] = doc.metadata["source"]
228
  i += 1
229
  if sources:
230
  await websocket.send_json({'sources': sources})
 
223
  if (index+1) in citation_numbers:
224
  sources[f"[{index+1}]"] = doc.metadata["source"]
225
  else:
226
+ if doc.metadata["source"] not in backup.values():
227
+ backup[f"[{i}]"] = doc.metadata["source"]
228
  i += 1
229
  if sources:
230
  await websocket.send_json({'sources': sources})