barretto commited on
Commit
e1ab2b1
·
1 Parent(s): 0b2c1a2

first draft

Browse files
Files changed (1) hide show
  1. app.py +24 -4
app.py CHANGED
@@ -1,7 +1,27 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ def sentence_builder(quantity, animal, place, activity_list, morning):
4
+ return f"""The {quantity} {animal}s 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.Radio(["park", "zoo", "road"], label="Gender" ),
10
+ gr.Dropdown(["South Asian, North Asian, White, African American, African, American Indian, Hispanic"], label="Ethnicity"),
11
+ gr.Dropdown(["Black", "Brown", "Yellow", "Peach","Tan","Beige", "White", "Grey"], label="Skin color" ),
12
+ gr.Dropdown(["Black","Dark brown", "Light", "brown", "Blonde", "Red", "Grey", "Blue", "Pink"], label="Hair color" ),
13
+ gr.Dropdown(["Black", "Dark Brown", "Light Brown", "Green", "Blue", "Hazel", "Amber", "Red", "Pink"], label="Eye color" ),
14
+ gr.CheckboxGroup(["Nose", "Ear", "Eyebrow", "Tongue", "Lips", "Cheeks"], label="Piercings"),
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()