Spaces:
Sleeping
Sleeping
first commit
Browse files- app.py +16 -0
- requirements.txt +0 -0
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
9 |
+
|
10 |
+
|
11 |
+
if __name__ == '__main__':
|
12 |
+
demo = gr.Interface(fn=greet,
|
13 |
+
inputs=["text", 'checkbox', gr.Slider(0, 100)],
|
14 |
+
outputs=["text", "number"],
|
15 |
+
live=True)
|
16 |
+
demo.launch()
|
requirements.txt
ADDED
File without changes
|