angry-meow commited on
Commit
2389c43
·
1 Parent(s): 28c2531

url loading testing

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -84,16 +84,14 @@ async def handle_response(res):
84
  await msg.send()
85
 
86
  # load the file
87
- docs = process_file(file)
88
- splits = models.semanticChunker_tuned.split_documents(docs)
89
  for i, doc in enumerate(splits):
90
  doc.metadata["user_upload_source"] = f"source_{i}"
91
  print(f"Processing {len(docs)} text chunks")
92
 
93
  # Add to the qdrant_store
94
- qdrant_store.add_documents(
95
- documents=splits
96
- )
97
 
98
  msg.content = f"Processing `{file.name}` done. You can now ask questions!"
99
  await msg.update()
 
84
  await msg.send()
85
 
86
  # load the file
87
+ docs = await asyncio.to_thread(process_file, file)
88
+ splits = await asyncio.to_thread(models.semanticChunker_tuned.split_documents, docs)
89
  for i, doc in enumerate(splits):
90
  doc.metadata["user_upload_source"] = f"source_{i}"
91
  print(f"Processing {len(docs)} text chunks")
92
 
93
  # Add to the qdrant_store
94
+ await asyncio.to_thread(qdrant_store.add_documents, splits)
 
 
95
 
96
  msg.content = f"Processing `{file.name}` done. You can now ask questions!"
97
  await msg.update()