Spaces:
Sleeping
Sleeping
Download app.py from consy/ChatbotLab4.7: direct link, hf CLI and curl.
- Browser
- Download file 687 Bytes
-
https://huggingface.co/spaces/consy/ChatbotLab4.7/resolve/main/app.py
- Command line
-
hf download hf://spaces/consy/ChatbotLab4.7/app.py
-
curl -L -o app.py https://huggingface.co/spaces/consy/ChatbotLab4.7/resolve/main/app.py
687 Bytes
| import gradio as gr | |
| import random | |
| #import lines go at the top! | |
| def magic_ball(message, history): | |
| return random.choice(['Try again!','Maybe','Without a doubt']) | |
| #def yes_or_no(message,history): | |
| #return random.choice(['Yes','No']) | |
| #def echo(message, history): | |
| #always need two inputs | |
| #return message | |
| print("Hello, World") | |
| chatbot = gr.ChatInterface(magic_ball, | |
| title = 'The Psychic Magic 8 Ball', | |
| description = 'Ask any yes or no question to learn your future', | |
| type='messages') | |
| #defining my chatbot so user can interact, see their conversation and send new messages | |
| chatbot.launch() |