Tonyivan commited on
Commit
b70346c
·
verified ·
1 Parent(s): 6ac9588

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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 T5Response(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
 
 
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