Samet Yilmaz commited on
Commit
c32151f
1 Parent(s): 5589f0c

Reorganize

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -50,8 +50,7 @@ def infer(image_url, prompt, progress=gr.Progress(track_tqdm=True)):
50
  return outputs[0].outputs[0].text
51
 
52
 
53
- example_images = ["https://picsum.photos/id/237/200/300"]
54
- example_prompts = ["What do you see in this image?"]
55
 
56
  css = """
57
  #col-container {
@@ -75,6 +74,7 @@ with gr.Blocks(css=css) as demo:
75
  container=False,
76
  )
77
 
 
78
  image_url = gr.Text(
79
  label="Image URL",
80
  show_label=False,
@@ -83,6 +83,7 @@ with gr.Blocks(css=css) as demo:
83
  container=False,
84
  )
85
 
 
86
  run_button = gr.Button("Run", scale=0)
87
 
88
  result = gr.Textbox(
@@ -90,13 +91,8 @@ with gr.Blocks(css=css) as demo:
90
  )
91
 
92
  gr.Examples(
93
- examples=example_images,
94
- inputs=[image_url]
95
- )
96
-
97
- gr.Examples(
98
- examples=example_prompts,
99
- inputs=[prompt]
100
  )
101
  gr.on(
102
  triggers=[run_button.click, image_url.submit, prompt.submit],
 
50
  return outputs[0].outputs[0].text
51
 
52
 
53
+ examples = [["https://picsum.photos/id/237/200/300", "What do you see in this image?"]]
 
54
 
55
  css = """
56
  #col-container {
 
74
  container=False,
75
  )
76
 
77
+ with gr.Row():
78
  image_url = gr.Text(
79
  label="Image URL",
80
  show_label=False,
 
83
  container=False,
84
  )
85
 
86
+ with gr.Row():
87
  run_button = gr.Button("Run", scale=0)
88
 
89
  result = gr.Textbox(
 
91
  )
92
 
93
  gr.Examples(
94
+ examples=examples,
95
+ inputs=[image_url, prompt]
 
 
 
 
 
96
  )
97
  gr.on(
98
  triggers=[run_button.click, image_url.submit, prompt.submit],