muryshev commited on
Commit
9fe1fc4
1 Parent(s): 74a3564

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- 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'])
 
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'])