Spaces:
Runtime error
Runtime error
justest
commited on
Commit
·
900076b
1
Parent(s):
1aae827
update
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ with gr.Blocks() as demo:
|
|
77 |
|
78 |
memory = ConversationBufferWindowMemory(k=10, memory_key="chat_history")
|
79 |
|
80 |
-
chatbot = gr.Chatbot([
|
81 |
msg = gr.Textbox(value="", label='请输入:')
|
82 |
with gr.Row():
|
83 |
clear = gr.Button("清空对话", scale=2)
|
@@ -138,7 +138,7 @@ with gr.Blocks() as demo:
|
|
138 |
|
139 |
print(history)
|
140 |
messages = []
|
141 |
-
for user_message, assistant_message in history[
|
142 |
messages.append({"role": "user", "content": user_message})
|
143 |
messages.append({"role": "assistant", "content": assistant_message})
|
144 |
messages.append({"role": "user", "content": history[-1][0]})
|
|
|
77 |
|
78 |
memory = ConversationBufferWindowMemory(k=10, memory_key="chat_history")
|
79 |
|
80 |
+
chatbot = gr.Chatbot([], label='AI')
|
81 |
msg = gr.Textbox(value="", label='请输入:')
|
82 |
with gr.Row():
|
83 |
clear = gr.Button("清空对话", scale=2)
|
|
|
138 |
|
139 |
print(history)
|
140 |
messages = []
|
141 |
+
for user_message, assistant_message in history[:-1]:
|
142 |
messages.append({"role": "user", "content": user_message})
|
143 |
messages.append({"role": "assistant", "content": assistant_message})
|
144 |
messages.append({"role": "user", "content": history[-1][0]})
|