Hadiil commited on
Commit
9f1ee9c
·
verified ·
1 Parent(s): 08e09ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -48,7 +48,7 @@ async def summarize_text(file: UploadFile = File(None), text: str = Form(None)):
48
  if file:
49
  text = await extract_text_from_file(file)
50
  elif not text:
51
- raise HTTPException(status_code=400, detail="No text or file provided")
52
 
53
  summary = text_pipeline(f"summarize: {text}", max_length=100)
54
  return {"summary": summary[0]['generated_text']}
 
48
  if file:
49
  text = await extract_text_from_file(file)
50
  elif not text:
51
+ raise HTTPException(status_code=400, detail="No text or files provided")
52
 
53
  summary = text_pipeline(f"summarize: {text}", max_length=100)
54
  return {"summary": summary[0]['generated_text']}