Spaces:
Runtime error
Runtime error
Fixed a bug for encoder.
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ def evaluate_stream(msg, history, temperature, top_p):
|
|
86 |
|
87 |
# TODO: Avoid the tokens are too long.
|
88 |
CUTOFF = 160
|
89 |
-
while tokenizer.encode(context) > CUTOFF:
|
90 |
# save 15 token size for the answer
|
91 |
context = context[15:]
|
92 |
|
|
|
86 |
|
87 |
# TODO: Avoid the tokens are too long.
|
88 |
CUTOFF = 160
|
89 |
+
while len(tokenizer.encode(context)) > CUTOFF:
|
90 |
# save 15 token size for the answer
|
91 |
context = context[15:]
|
92 |
|