Spaces:
Sleeping
Sleeping
| 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() |