Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -269,9 +269,8 @@ def create_ui():
|
|
269 |
with requirements_tab:
|
270 |
requirements_content = gr.Textbox(label="requirements.txt", lines=30)
|
271 |
|
272 |
-
|
273 |
with gr.TabItem("AI ์ฝ๋ฉ"):
|
274 |
-
chatbot = gr.Chatbot(label="๋ํ", type="
|
275 |
msg = gr.Textbox(label="๋ฉ์์ง")
|
276 |
|
277 |
# ์จ๊ฒจ์ง ์ํ๋ก ํ๋ผ๋ฏธํฐ ์ค์
|
@@ -292,14 +291,12 @@ def create_ui():
|
|
292 |
|
293 |
def respond_wrapper(message, chat_history, max_tokens, temperature, top_p):
|
294 |
bot_message = respond(message, chat_history, max_tokens, temperature, top_p)
|
295 |
-
chat_history.append(
|
296 |
-
chat_history.append({"role": "assistant", "content": bot_message})
|
297 |
return "", chat_history
|
298 |
|
299 |
msg.submit(respond_wrapper, [msg, chatbot, max_tokens, temperature, top_p], [msg, chatbot])
|
300 |
|
301 |
|
302 |
-
|
303 |
space_id_state = gr.State()
|
304 |
tree_structure_state = gr.State()
|
305 |
|
|
|
269 |
with requirements_tab:
|
270 |
requirements_content = gr.Textbox(label="requirements.txt", lines=30)
|
271 |
|
|
|
272 |
with gr.TabItem("AI ์ฝ๋ฉ"):
|
273 |
+
chatbot = gr.Chatbot(label="๋ํ", type="messages") # ์ฌ๊ธฐ๋ฅผ 'messages'๋ก ์์
|
274 |
msg = gr.Textbox(label="๋ฉ์์ง")
|
275 |
|
276 |
# ์จ๊ฒจ์ง ์ํ๋ก ํ๋ผ๋ฏธํฐ ์ค์
|
|
|
291 |
|
292 |
def respond_wrapper(message, chat_history, max_tokens, temperature, top_p):
|
293 |
bot_message = respond(message, chat_history, max_tokens, temperature, top_p)
|
294 |
+
chat_history.append((message, bot_message)) # ํํ ํ์์ผ๋ก ๋ณ๊ฒฝ
|
|
|
295 |
return "", chat_history
|
296 |
|
297 |
msg.submit(respond_wrapper, [msg, chatbot, max_tokens, temperature, top_p], [msg, chatbot])
|
298 |
|
299 |
|
|
|
300 |
space_id_state = gr.State()
|
301 |
tree_structure_state = gr.State()
|
302 |
|