File size: 1,217 Bytes
02ee6ce
b7b615e
02ee6ce
b7b615e
d146794
 
b7b615e
 
 
 
861de45
9e52633
afb7542
b7b615e
722d2fe
 
 
861de45
a410e29
2c449ba
 
 
be305ff
 
3fc3932
2c449ba
722d2fe
02ee6ce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr
import random

def echo(message, history):
    return message

def yes_no(message, history):
    responses = ["Yes", "No"]
    return random.choice(responses)

def magic_eight(message, history):
    responses = ["That's a terrible question. Try again", "I don't think I should answer that...", "What do you think, genius?", "You are a bad person for asking that.", "Absolutely not", "Uuuuh, obviously.", "Of all the things you could ask, you went with that?", "I don't know, look it up", "I mean, yeah, I guess...", "That's gonna be a big nope", "Bruh... really?"]
    return random.choice(responses)

title = """ # **Spicy** Magic 8-Ball"""
about_text = """##Ask a question, get an answer"""

with gr.Blocks(theme='mgetz/Celeb_glitzy') as chatbot:
    with gr.Row(scale=1):
        gr.Image("8-Ball-Banner.png")
    with gr.Row(scale=3):
        with gr.Column(scale = 1):
            gr.Markdown(title)
            gr.Markdown(about_text)
            gr.Image("Cracked_Ball.jpg", show_label = False, show_share_button = False, show_download_button = False)
        with gr.Column(scale = 2):
            gr.ChatInterface(magic_eight, type="messages", theme="mgetz/Celeb_glitzy")
chatbot.launch()