Spaces:
Paused
Paused
Download simple-app.py from alliwene/chat-bot-test: direct link, hf CLI and curl.
- Browser
- Download file 472 Bytes
-
https://huggingface.co/spaces/alliwene/chat-bot-test/resolve/main/simple-app.py
- Command line
-
hf download hf://spaces/alliwene/chat-bot-test/simple-app.py
-
curl -L -o simple-app.py https://huggingface.co/spaces/alliwene/chat-bot-test/resolve/main/simple-app.py
472 Bytes
| import gradio as gr | |
| import random | |
| import time | |
| with gr.Blocks() as demo: | |
| chatbot = gr.Chatbot() | |
| msg = gr.Textbox() | |
| clear = gr.ClearButton([msg, chatbot]) | |
| def respond(message, chat_history): | |
| bot_message = random.choice(["How are you?", "I love you", "I'm very hungry"]) | |
| chat_history.append((message, bot_message)) | |
| time.sleep(2) | |
| return "", chat_history | |
| msg.submit(respond, [msg, chatbot], [msg, chatbot]) | |
| demo.launch() | |