saja003 commited on
Commit
218c3b8
·
verified ·
1 Parent(s): f29570a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -2,13 +2,18 @@ import gradio as gr
2
 
3
  def greet(feel):
4
  if feel.lower() == "yes":
5
- return "That's Good"
6
  elif feel.lower() == "no":
7
- return "That's Bad"
8
  else:
9
- return "Invalid Input"
10
 
11
- demo = gr.Interface(fn=greet, description="Are you Happy?",
12
- inputs="text",
13
- outputs="text")
14
- demo.launch()
 
 
 
 
 
 
2
 
3
  def greet(feel):
4
  if feel.lower() == "yes":
5
+ return "I'm glad to hear that! Keep up the positivity!"
6
  elif feel.lower() == "no":
7
+ return "I'm sorry to hear that. I hope things get better soon."
8
  else:
9
+ return "Please select a valid option to proceed."
10
 
11
+ demo = gr.Interface(
12
+ fn=greet,
13
+ description="Please select if you are happy or not.",
14
+ title="Happiness Checker",
15
+ inputs=gr.inputs.Radio(["Yes", "No"], label="Are you happy?"),
16
+ outputs="text"
17
+ )
18
+
19
+ demo.launch()