raptor1 commited on
Commit
f2c7f16
·
verified ·
1 Parent(s): 92efa70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -24,7 +24,7 @@ def summarize_and_sentiment(text):
24
 
25
  # Checking if text length is at least 150 characters as I have set max_length for output token = 150
26
  if len(text) < 150:
27
- return "Error: Text should be in between 150 and 500 characters long. Please increase the length of the text.", "" #Using "" as second argument so that when an error occurs the function returns two values instead of one and this is what expected in Gradio UI.The outputs would no longer match the expected structure if we return just one outpit from function.
28
 
29
 
30
  # Generate summary using summarizer pipeline
 
24
 
25
  # Checking if text length is at least 150 characters as I have set max_length for output token = 150
26
  if len(text) < 150:
27
+ return "Error: Text should be greater than 150 characters in length. Please increase the length of the text.", "" #Using "" as second argument so that when an error occurs the function returns two values instead of one and this is what expected in Gradio UI.The outputs would no longer match the expected structure if we return just one outpit from function.
28
 
29
 
30
  # Generate summary using summarizer pipeline