xu song
commited on
Commit
•
55b26f1
1
Parent(s):
75b1ba6
update
Browse files- 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"]
|
68 |
streamer = generate_query(chatbot, history)
|
69 |
-
elif history[-1]["role"]
|
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")
|