shroogawh2 commited on
Commit
44e4c79
·
verified ·
1 Parent(s): 3b0cefc

Create shroog.py

Browse files
Files changed (1) hide show
  1. shroog.py +30 -0
shroog.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def sentence_builder(quantity, animal, countries, place, activity_list, morning):
4
+ 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"}"""
5
+
6
+ demo = gr.Interface(
7
+ sentence_builder,
8
+ [
9
+ gr.Slider(2, 20, value=4, label="Count", info="Choose between 2 and 20"),
10
+ gr.Dropdown(
11
+ ["cat", "dog", "bird"], label="Animal", info="Will add more animals later!"
12
+ ),
13
+ gr.CheckboxGroup(["Saudi", "Paris", "Pakistan"], label="Countries", info="Where are they from?"),
14
+ gr.Radio(["park", "zoo", "road"], label="Location", info="Where did they go?"),
15
+ gr.Dropdown(
16
+ ["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."
17
+ ),
18
+ gr.Checkbox(label="Morning", info="Did they do it in the morning?"),
19
+ ],
20
+ "text",
21
+ examples=[
22
+ [2, "cat", ["Saudi", "Pakistan"], "park", ["ate", "swam"], True],
23
+ [4, "dog", ["Saudi"], "zoo", ["ate", "swam"], False],
24
+ [10, "bird", ["USA", "Pakistan"], "road", ["ran"], False],
25
+ [8, "cat", ["Pakistan"], "zoo", ["ate"], True],
26
+ ]
27
+ )
28
+
29
+ if __name__ == "__main__":
30
+ demo.launch()