Spaces:
Sleeping
Sleeping
Commit
·
616f9d7
1
Parent(s):
93b660b
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,15 @@
|
|
|
|
|
|
1 |
|
2 |
-
def greet(name):
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
demo = gr.Interface(
|
6 |
fn=greet,
|
7 |
-
|
8 |
-
|
9 |
-
outputs="text",
|
10 |
)
|
11 |
-
demo.launch()
|
|
|
1 |
+
# https://www.gradio.app/guides/quickstart
|
2 |
+
import gradio as gr
|
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 |
demo = gr.Interface(
|
11 |
fn=greet,
|
12 |
+
inputs=["text", "checkbox", gr.Slider(0, 100)],
|
13 |
+
outputs=["text", "number"],
|
|
|
14 |
)
|
15 |
+
demo.launch()
|