loisk commited on
Commit
4c1ab07
1 Parent(s): ef371a3

Updated app file

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -1,9 +1,16 @@
1
  import gradio as gr
2
 
3
 
4
- def greet(name):
5
- return "Hello " + name + "!!"
 
 
 
6
 
7
 
8
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
9
  iface.launch()
 
1
  import gradio as gr
2
 
3
 
4
+ def greet(name, is_morning, temperature):
5
+ salutation = "Good morning" if is_morning else "Good evening"
6
+ greeting = f"{salutation} {name}. It is {temperature} degrees today"
7
+ celsius = (temperature - 32) * 5 / 9
8
+ return greeting, round(celsius, 2)
9
 
10
 
11
+ iface = gr.Interface(
12
+ fn=greet,
13
+ inputs=["text", "checkbox", gr.Slider(0, 100)],
14
+ outputs=["text", "number"],
15
+ )
16
  iface.launch()