Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
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
|