bertugmirasyedi commited on
Commit
4021af8
·
1 Parent(s): 1b4a9c9

Fixed NoneType error in the case of no data returned from the API

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -451,7 +451,7 @@ async def summarize(descriptions: list, runtime="normal"):
451
  # Summarize the descriptions
452
  summaries = [
453
  summarizer_pipe(description)
454
- if (len(description) > 0 and description != "Null" and description != None)
455
  else [{"summary_text": "No summary text is available."}]
456
  for description in descriptions
457
  ]
 
451
  # Summarize the descriptions
452
  summaries = [
453
  summarizer_pipe(description)
454
+ if (description != "Null" and description != None)
455
  else [{"summary_text": "No summary text is available."}]
456
  for description in descriptions
457
  ]