ffreemt commited on
Commit
d017960
·
1 Parent(s): 65b746b
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -132,14 +132,14 @@ def bot(chat_history, **kwargs):
132
  return chat_history
133
 
134
 
135
- def bot_stream(chat_history):
136
  try:
137
  message = chat_history[-1][0]
138
  except Exception as exc:
139
  logger.error(f"{chat_history=}: {exc}")
140
  raise gr.Error(f"{chat_history=}")
141
  # yield chat_history
142
- for elm in model.chat_stream(tokenizer, message, chat_history):
143
  chat_history[-1] = [message, elm]
144
  yield chat_history
145
 
 
132
  return chat_history
133
 
134
 
135
+ def bot_stream(chat_history, **kwargs):
136
  try:
137
  message = chat_history[-1][0]
138
  except Exception as exc:
139
  logger.error(f"{chat_history=}: {exc}")
140
  raise gr.Error(f"{chat_history=}")
141
  # yield chat_history
142
+ for elm in model.chat_stream(tokenizer, message, chat_history, **kwargs):
143
  chat_history[-1] = [message, elm]
144
  yield chat_history
145