Update app.py
Browse files
app.py
CHANGED
@@ -193,13 +193,13 @@ def generate_unknown_response():
|
|
193 |
|
194 |
response_tokens = bytearray()
|
195 |
def generate_and_log_tokens(user_request, model, generator):
|
196 |
-
global response_tokens
|
197 |
for token in generate_tokens(model, generator):
|
198 |
-
if token == b'': # or (max_new_tokens is not None and i >= max_new_tokens):
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
response_tokens.extend(token)
|
203 |
yield token
|
204 |
|
205 |
@app.route('/', methods=['POST'])
|
|
|
193 |
|
194 |
response_tokens = bytearray()
|
195 |
def generate_and_log_tokens(user_request, model, generator):
|
196 |
+
#global response_tokens
|
197 |
for token in generate_tokens(model, generator):
|
198 |
+
#if token == b'': # or (max_new_tokens is not None and i >= max_new_tokens):
|
199 |
+
# log(user_request, response_tokens)#.decode("utf-8", errors="ignore"))
|
200 |
+
# response_tokens = bytearray()
|
201 |
+
# break
|
202 |
+
#response_tokens.extend(token)
|
203 |
yield token
|
204 |
|
205 |
@app.route('/', methods=['POST'])
|