Harshveer commited on
Commit
513b32d
Β·
1 Parent(s): e28490f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -24,7 +24,7 @@ def generate(starting_text):
24
  response_list = []
25
  for x in response:
26
  resp = x['generated_text'].strip()
27
- if resp != starting_text and len(resp) > (len(starting_text) + 1) and resp.endswith((":", "-", "β€”")) is False:
28
  response_list.append(resp+'\n')
29
  response_end = "\n".join(response_list)
30
  response_end = re.sub('[^ ]+\.[^ ]+','', response_end)
@@ -46,7 +46,7 @@ for model in models:
46
 
47
 
48
  def text_it(inputs,text_gen=generate):
49
- return text_gen(inputs)
50
 
51
 
52
  def set_model(current_model_index):
 
24
  response_list = []
25
  for x in response:
26
  resp = x['generated_text'].strip()
27
+ if resp != starting_text and len(resp) > (len(starting_text) + 4) and resp.endswith((":", "-", "β€”")) is False:
28
  response_list.append(resp+'\n')
29
  response_end = "\n".join(response_list)
30
  response_end = re.sub('[^ ]+\.[^ ]+','', response_end)
 
46
 
47
 
48
  def text_it(inputs,text_gen=generate):
49
+ return text_gen(inputs)[0]
50
 
51
 
52
  def set_model(current_model_index):