xu song commited on
Commit
75b1ba6
1 Parent(s): e4e3ccf
Files changed (1) hide show
  1. app_util.py +3 -2
app_util.py CHANGED
@@ -62,11 +62,12 @@ def generate_response(chatbot, history, user_input=None):
62
 
63
 
64
  def generate(chatbot, history):
 
65
  streamer = None
66
  if history[-1]["role"] == "assistant":
67
- streamer = generate_response(chatbot, history)
68
- elif history[-1]["role"] in ["user", "system"]:
69
  streamer = generate_query(chatbot, history)
 
 
70
  else:
71
  gr.Warning("bug")
72
 
 
62
 
63
 
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")
73