xu song commited on
Commit
55b26f1
1 Parent(s): 75b1ba6
Files changed (1) hide show
  1. app_util.py +2 -2
app_util.py CHANGED
@@ -64,9 +64,9 @@ def generate_response(chatbot, history, user_input=None):
64
  def generate(chatbot, history):
65
  logger.info(f"chatbot: {chatbot}; history: {history}")
66
  streamer = None
67
- if history[-1]["role"] == "assistant":
68
  streamer = generate_query(chatbot, history)
69
- elif history[-1]["role"] in ["user", "system"]:
70
  streamer = generate_response(chatbot, history)
71
  else:
72
  gr.Warning("bug")
 
64
  def generate(chatbot, history):
65
  logger.info(f"chatbot: {chatbot}; history: {history}")
66
  streamer = None
67
+ if history[-1]["role"] in ["assistant", "system"]:
68
  streamer = generate_query(chatbot, history)
69
+ elif history[-1]["role"] == "user":
70
  streamer = generate_response(chatbot, history)
71
  else:
72
  gr.Warning("bug")