Spaces:
Running
Running
File size: 446 Bytes
54e32c3 00e3c78 54e32c3 00e3c78 54e32c3 00e3c78 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import gradio as gr
def respond(message, chat_history):
if chat_history is None:
chat_history = []
# Энгийн reply
reply = f"Чи бичсэн: {message}"
chat_history.append((message, reply))
return chat_history, chat_history
with gr.Blocks() as demo:
chatbot = gr.Chatbot()
msg = gr.Textbox(label="Message")
state = gr.State()
msg.submit(respond, [msg, state], [chatbot, state])
demo.launch() |