tnt306 commited on
Commit
da09203
·
1 Parent(s): 72baa29

Test Block

Browse files
Files changed (1) hide show
  1. app.py +15 -22
app.py CHANGED
@@ -17,28 +17,21 @@ article = "This is article."
17
  def sentence_builder(quantity, animal, countries, place, activity_list, morning):
18
  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"}"""
19
 
20
- demo = gr.Interface(
21
- sentence_builder,
22
- [
23
- gr.Slider(2, 20, value=4, label="Count", info="Choose between 2 and 20"),
24
- gr.Dropdown(
25
- ["cat", "dog", "bird"], label="Animal", info="Will add more animals later!"
26
- ),
27
- gr.CheckboxGroup(["USA", "Japan", "Pakistan"], label="Countries", info="Where are they from?"),
28
- gr.Radio(["park", "zoo", "road"], label="Location", info="Where did they go?"),
29
- gr.Dropdown(
30
- ["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."
31
- ),
32
- gr.Checkbox(label="Morning", info="Did they do it in the morning?"),
33
- ],
34
- "text",
35
- examples=[
36
- [2, "cat", ["Japan", "Pakistan"], "park", ["ate", "swam"], True],
37
- [4, "dog", ["Japan"], "zoo", ["ate", "swam"], False],
38
- [10, "bird", ["USA", "Pakistan"], "road", ["ran"], False],
39
- [8, "cat", ["Pakistan"], "zoo", ["ate"], True],
40
- ]
41
- )
42
 
43
  demo.launch(debug=False,
44
  share=True)
 
17
  def sentence_builder(quantity, animal, countries, place, activity_list, morning):
18
  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"}"""
19
 
20
+ with gr.Blocks() as demo:
21
+ with gr.Row():
22
+ text1 = gr.Textbox(label="t1")
23
+ slider2 = gr.Textbox(label="s2")
24
+ drop3 = gr.Dropdown(["a", "b", "c"], label="d3")
25
+ with gr.Row():
26
+ with gr.Column(scale=1, min_width=300):
27
+ text1 = gr.Textbox(label="prompt 1")
28
+ text2 = gr.Textbox(label="prompt 2")
29
+ inbtw = gr.Button("Between")
30
+ text4 = gr.Textbox(label="prompt 1")
31
+ text5 = gr.Textbox(label="prompt 2")
32
+ with gr.Column(scale=2, min_width=300):
33
+ img1 = gr.Image("images/cheetah.jpg")
34
+ btn = gr.Button("Go")
 
 
 
 
 
 
 
35
 
36
  demo.launch(debug=False,
37
  share=True)