Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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) +
|
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):
|