Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -195,10 +195,10 @@ def parse_llm_response(content: str) -> str:
|
|
| 195 |
async def run_hackrx(req: RunRequest):
|
| 196 |
doc_url = str(req.documents)
|
| 197 |
start_time = time.time()
|
| 198 |
-
if(doc_url not in vector_cache):
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
end_time = time.time() - start_time
|
| 203 |
print(f"chunking done: {end_time}")
|
| 204 |
# if not chunks:
|
|
|
|
| 195 |
async def run_hackrx(req: RunRequest):
|
| 196 |
doc_url = str(req.documents)
|
| 197 |
start_time = time.time()
|
| 198 |
+
# if(doc_url not in vector_cache):
|
| 199 |
+
chunks = load_and_chunk(str(req.documents))
|
| 200 |
+
if not chunks:
|
| 201 |
+
return JSONResponse({"error": "No documents could be processed."}, status_code=400)
|
| 202 |
end_time = time.time() - start_time
|
| 203 |
print(f"chunking done: {end_time}")
|
| 204 |
# if not chunks:
|