Spaces:
Running
Running
Upload with huggingface_hub
Browse files- README.md +6 -6
- __pycache__/run.cpython-36.pyc +0 -0
- app.py +27 -0
- screenshot.png +0 -0
README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.3.1
|
|
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
+
|
2 |
---
|
3 |
+
title: sentence_builder
|
4 |
+
emoji: 🔥
|
5 |
+
colorFrom: indigo
|
6 |
+
colorTo: indigo
|
7 |
sdk: gradio
|
8 |
sdk_version: 3.3.1
|
9 |
+
|
10 |
app_file: app.py
|
11 |
pinned: false
|
12 |
---
|
|
|
|
__pycache__/run.cpython-36.pyc
ADDED
Binary file (874 Bytes). View file
|
|
app.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
|
4 |
+
def sentence_builder(quantity, animal, place, activity_list, morning):
|
5 |
+
return f"""The {quantity} {animal}s went to the {place} where they {" and ".join(activity_list)} until the {"morning" if morning else "night"}"""
|
6 |
+
|
7 |
+
|
8 |
+
demo = gr.Interface(
|
9 |
+
sentence_builder,
|
10 |
+
[
|
11 |
+
gr.Slider(2, 20, value=4),
|
12 |
+
gr.Dropdown(["cat", "dog", "bird"]),
|
13 |
+
gr.Radio(["park", "zoo", "road"]),
|
14 |
+
gr.CheckboxGroup(["ran", "swam", "ate", "slept"]),
|
15 |
+
gr.Checkbox(label="Is it the morning?"),
|
16 |
+
],
|
17 |
+
"text",
|
18 |
+
examples=[
|
19 |
+
[2, "cat", "park", ["ran", "swam"], True],
|
20 |
+
[4, "dog", "zoo", ["ate", "swam"], False],
|
21 |
+
[10, "bird", "road", ["ran"], False],
|
22 |
+
[8, "cat", "zoo", ["ate"], True],
|
23 |
+
],
|
24 |
+
)
|
25 |
+
|
26 |
+
if __name__ == "__main__":
|
27 |
+
demo.launch()
|
screenshot.png
ADDED