pius-code commited on
Commit
3ba8f58
·
1 Parent(s): 0594f08

update summarize endpoint to return summary as a JSON object

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -17,4 +17,4 @@ async def root():
17
  @app.post("/summarize")
18
  async def summarize_text(input: TextInput):
19
  summary = (summarizer(input.text, max_length=130, min_length=30, do_sample=False))
20
- return "hello welcome to the summary end point"
 
17
  @app.post("/summarize")
18
  async def summarize_text(input: TextInput):
19
  summary = (summarizer(input.text, max_length=130, min_length=30, do_sample=False))
20
+ return {"summary": summary[0]['summary_text']}