Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import random | |
| def eight_ball(message, history): | |
| return random.choice(['Try again later!', 'Not so fast...', "It's lookin good babe!"]) | |
| def vote(data: gr.LikeData): | |
| if data.liked: | |
| print("You upvoted this response: " + data.value["value"]) | |
| else: | |
| print("You downvoted this response: " + data.value["value"]) | |
| # def yes_or_no(message, history): | |
| # return random.choice(['yes', 'no']) | |
| # def echo(message, history): | |
| # return message | |
| print("Hello, world!") | |
| with gr.Blocks() as demo: | |
| chatbot = gr.ChatInterface(eight_ball, type="messages", placeholder="<strong>Magic 8 Ball!!!</strong><br>Ask me any yes or no question!") | |
| chatbot.like(vote, None, None) | |
| chatbot.launch() |