djsull commited on
Commit
9b4cee6
1 Parent(s): 8b5e2a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
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')