Spaces:
Runtime error
Runtime error
Adapted to the final model; with advanced delimiter and cutoff.
Browse files
app.py
CHANGED
@@ -79,13 +79,13 @@ def evaluate_stream(msg, history, temperature, top_p):
|
|
79 |
|
80 |
# concatenate context
|
81 |
for h in history[:-1]:
|
82 |
-
context += h[0] + "
|
83 |
|
84 |
context += history[-1][0]
|
85 |
context = context.replace(r'<br>', '')
|
86 |
|
87 |
# TODO: Avoid the tokens are too long.
|
88 |
-
CUTOFF =
|
89 |
while len(tokenizer.encode(context)) > CUTOFF:
|
90 |
# save 15 token size for the answer
|
91 |
context = context[15:]
|
|
|
79 |
|
80 |
# concatenate context
|
81 |
for h in history[:-1]:
|
82 |
+
context += h[0] + "||" + h[1] + "||"
|
83 |
|
84 |
context += history[-1][0]
|
85 |
context = context.replace(r'<br>', '')
|
86 |
|
87 |
# TODO: Avoid the tokens are too long.
|
88 |
+
CUTOFF = 224
|
89 |
while len(tokenizer.encode(context)) > CUTOFF:
|
90 |
# save 15 token size for the answer
|
91 |
context = context[15:]
|