Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ async def makeAnswer(request: Request):
|
|
41 |
# Summarize the context
|
42 |
raw_data = await request.json()
|
43 |
response = summarizer(raw_data['context'], max_length=130, min_length=30, do_sample=False)
|
44 |
-
return
|
45 |
except Exception as e:
|
46 |
raise HTTPException(status_code=500, detail=f"Error in T5 summarization: {str(e)}")
|
47 |
|
|
|
41 |
# Summarize the context
|
42 |
raw_data = await request.json()
|
43 |
response = summarizer(raw_data['context'], max_length=130, min_length=30, do_sample=False)
|
44 |
+
return JSONResponse(content={'answer':response[0]["summary_text"]})
|
45 |
except Exception as e:
|
46 |
raise HTTPException(status_code=500, detail=f"Error in T5 summarization: {str(e)}")
|
47 |
|