Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,6 +64,8 @@ def evaluate(
|
|
| 64 |
if token in args.token_stop:
|
| 65 |
break
|
| 66 |
all_tokens += [token]
|
|
|
|
|
|
|
| 67 |
if token not in occurrence:
|
| 68 |
occurrence[token] = 1
|
| 69 |
else:
|
|
@@ -180,7 +182,8 @@ def chat(
|
|
| 180 |
if token == 0:
|
| 181 |
next_tokens = pipeline.encode('\n\n')
|
| 182 |
all_tokens += next_tokens
|
| 183 |
-
|
|
|
|
| 184 |
if token not in occurrence:
|
| 185 |
occurrence[token] = 1
|
| 186 |
else:
|
|
@@ -199,7 +202,7 @@ def chat(
|
|
| 199 |
yield chatbot, history
|
| 200 |
|
| 201 |
out_str = pipeline.decode(all_tokens[begin:])
|
| 202 |
-
out_str = out_str.replace("\r\n", '\n')
|
| 203 |
|
| 204 |
if '\n\n' in out_str:
|
| 205 |
break
|
|
|
|
| 64 |
if token in args.token_stop:
|
| 65 |
break
|
| 66 |
all_tokens += [token]
|
| 67 |
+
for xxx in occurrence:
|
| 68 |
+
occurrence[xxx] *= 0.996
|
| 69 |
if token not in occurrence:
|
| 70 |
occurrence[token] = 1
|
| 71 |
else:
|
|
|
|
| 182 |
if token == 0:
|
| 183 |
next_tokens = pipeline.encode('\n\n')
|
| 184 |
all_tokens += next_tokens
|
| 185 |
+
for xxx in occurrence:
|
| 186 |
+
occurrence[xxx] *= 0.996
|
| 187 |
if token not in occurrence:
|
| 188 |
occurrence[token] = 1
|
| 189 |
else:
|
|
|
|
| 202 |
yield chatbot, history
|
| 203 |
|
| 204 |
out_str = pipeline.decode(all_tokens[begin:])
|
| 205 |
+
out_str = out_str.replace("\r\n", '\n')
|
| 206 |
|
| 207 |
if '\n\n' in out_str:
|
| 208 |
break
|