Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -798,14 +798,9 @@ async def summarize_document(request: Request, file: UploadFile = File(...)):
|
|
| 798 |
logger.error(f"Summarization failed: {str(e)}", exc_info=True)
|
| 799 |
raise HTTPException(500, "Document summarization failed")
|
| 800 |
|
| 801 |
-
from typing import Optional
|
| 802 |
-
import re
|
| 803 |
-
from fastapi import HTTPException
|
| 804 |
-
from concurrent.futures import ThreadPoolExecutor
|
| 805 |
|
| 806 |
-
executor = ThreadPoolExecutor(max_workers=4)
|
| 807 |
|
| 808 |
-
|
| 809 |
@limiter.limit("5/minute")
|
| 810 |
async def question_answering(
|
| 811 |
request: Request,
|
|
|
|
| 798 |
logger.error(f"Summarization failed: {str(e)}", exc_info=True)
|
| 799 |
raise HTTPException(500, "Document summarization failed")
|
| 800 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 801 |
|
|
|
|
| 802 |
|
| 803 |
+
@app.post("/qa")
|
| 804 |
@limiter.limit("5/minute")
|
| 805 |
async def question_answering(
|
| 806 |
request: Request,
|