savasy commited on
Commit
38ed60f
1 Parent(s): afae16d

Create app.py

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