Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,10 +8,33 @@ demo.launch()
|
|
8 |
"""
|
9 |
import gradio as gr
|
10 |
|
11 |
-
def greet(name):
|
12 |
-
return "Hello " + name + "!"
|
13 |
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
if __name__ == "__main__":
|
17 |
-
demo.launch()
|
|
|
8 |
"""
|
9 |
import gradio as gr
|
10 |
|
|
|
|
|
11 |
|
12 |
+
def sentence_builder(quantity, animal, countries, place, activity_list, morning):
|
13 |
+
return f"""The {quantity} {animal}s from {" and ".join(countries)} went to the {place} where they {" and ".join(activity_list)} until the {"morning" if morning else "night"}"""
|
14 |
+
|
15 |
+
|
16 |
+
demo = gr.Interface(
|
17 |
+
sentence_builder,
|
18 |
+
[
|
19 |
+
gr.Slider(2, 20, value=4, label="Count", info="Choose between 2 and 20"),
|
20 |
+
gr.Dropdown(
|
21 |
+
["cat", "dog", "bird"], label="Animal", info="Will add more animals later!"
|
22 |
+
),
|
23 |
+
gr.CheckboxGroup(["USA", "Japan", "Pakistan"], label="Countries", info="Where are they from?"),
|
24 |
+
gr.Radio(["park", "zoo", "road"], label="Location", info="Where did they go?"),
|
25 |
+
gr.Dropdown(
|
26 |
+
["ran", "swam", "ate", "slept"], value=["swam", "slept"], multiselect=True, label="Activity", info="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nisl eget ultricies aliquam, nunc nisl aliquet nunc, eget aliquam nisl nunc vel nisl."
|
27 |
+
),
|
28 |
+
gr.Checkbox(label="Morning", info="Did they do it in the morning?"),
|
29 |
+
],
|
30 |
+
"text",
|
31 |
+
examples=[
|
32 |
+
[2, "cat", ["Japan", "Pakistan"], "park", ["ate", "swam"], True],
|
33 |
+
[4, "dog", ["Japan"], "zoo", ["ate", "swam"], False],
|
34 |
+
[10, "bird", ["USA", "Pakistan"], "road", ["ran"], False],
|
35 |
+
[8, "cat", ["Pakistan"], "zoo", ["ate"], True],
|
36 |
+
]
|
37 |
+
)
|
38 |
+
|
39 |
if __name__ == "__main__":
|
40 |
+
demo.launch()
|