Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -281,8 +281,8 @@ def generate_response():
|
|
281 |
response_tokens = []
|
282 |
def generate_and_log_tokens(model, generator):
|
283 |
for token in generate_tokens(model, generator):
|
284 |
-
if token ==
|
285 |
-
log(user_request,
|
286 |
break
|
287 |
response_tokens.append(token)
|
288 |
yield token
|
|
|
281 |
response_tokens = []
|
282 |
def generate_and_log_tokens(model, generator):
|
283 |
for token in generate_tokens(model, generator):
|
284 |
+
if token == b'': # or (max_new_tokens is not None and i >= max_new_tokens):
|
285 |
+
log(user_request, response_tokens.decode("utf-8", errors="ignore"))
|
286 |
break
|
287 |
response_tokens.append(token)
|
288 |
yield token
|