File size: 524 Bytes
cb1457d
 
8865479
42b1304
218c3b8
f29570a
218c3b8
42b1304
218c3b8
cb1457d
218c3b8
 
 
 
a858b9e
218c3b8
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr

def greet(feel):
    if feel.lower() == "yes":
        return "I'm glad to hear that! Keep up the positivity!"
    elif feel.lower() == "no":
        return "I'm sorry to hear that. I hope things get better soon."
    else:
        return "Please select a valid option to proceed."

demo = gr.Interface(
    fn=greet,
    description="Please select if you are happy or not.",
    title="Happiness Checker",
    inputs=gr.Radio(["Yes", "No"], label="Are you happy?"),
    outputs="text"
)

demo.launch()