fffiloni commited on
Commit
506c2b2
·
verified ·
1 Parent(s): 924da7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -5
app.py CHANGED
@@ -11,8 +11,19 @@ def infer(image_in, question):
11
  print(result)
12
  return result
13
 
14
- gr.Interface(
15
- fn=infer,
16
- inputs=[gr.Image(type="filepath"), gr.Textbox()],
17
- outputs=[gr.Textbox()]
18
- ).launch()
 
 
 
 
 
 
 
 
 
 
 
 
11
  print(result)
12
  return result
13
 
14
+ with gr.Blocks() as demo:
15
+ with gr.Row():
16
+ with gr.Column():
17
+ image_in = gr.Image(sources=["upload"], type="filepath")
18
+ question = gr.Textbox()
19
+ submit_btn = gr.Button("Submit")
20
+ with gr.Column():
21
+ answer = gr.Textbox()
22
+
23
+ submit_btn.click(
24
+ fn=infer,
25
+ inputs=[image_in, question],
26
+ outputs=[answer]
27
+ )
28
+
29
+ demo.launch()