Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,9 @@ model = BartForConditionalGeneration.from_pretrained('djsull/aha-kobart-summariz
|
|
12 |
|
13 |
def predict(text):
|
14 |
text = text
|
|
|
|
|
|
|
15 |
text = re.sub('\n[0-9].', '\n', text)
|
16 |
text = re.sub('\n-.', '\n', text)
|
17 |
text_check = text.split('\n')
|
|
|
12 |
|
13 |
def predict(text):
|
14 |
text = text
|
15 |
+
if len(text) < 50:
|
16 |
+
error = 'query too short"
|
17 |
+
return error
|
18 |
text = re.sub('\n[0-9].', '\n', text)
|
19 |
text = re.sub('\n-.', '\n', text)
|
20 |
text_check = text.split('\n')
|