Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -41,28 +41,18 @@ with gr.Blocks(
|
|
41 |
with gr.Column(scale=1):
|
42 |
caption_output = None
|
43 |
chat_input = gr.Textbox(lines=1, label="VQA Input")
|
44 |
-
|
45 |
-
inference_chat,
|
46 |
-
[
|
47 |
-
image_input,
|
48 |
-
chat_input,
|
49 |
-
],
|
50 |
-
[ caption_output],
|
51 |
-
)
|
52 |
|
53 |
with gr.Row():
|
54 |
clear_button = gr.Button(value="Clear", interactive=True)
|
55 |
-
|
56 |
-
lambda: ("", [], []),
|
57 |
-
[],
|
58 |
-
[chat_input, state],
|
59 |
-
queue=False,
|
60 |
-
)
|
61 |
|
62 |
submit_button = gr.Button(
|
63 |
value="Submit", interactive=True, variant="primary"
|
64 |
)
|
65 |
-
|
|
|
|
|
66 |
inference_chat,
|
67 |
[
|
68 |
image_input,
|
@@ -70,8 +60,20 @@ with gr.Blocks(
|
|
70 |
],
|
71 |
[caption_output],
|
72 |
)
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
image_input.change(
|
77 |
lambda: ("", "", []),
|
|
|
41 |
with gr.Column(scale=1):
|
42 |
caption_output = None
|
43 |
chat_input = gr.Textbox(lines=1, label="VQA Input")
|
44 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
with gr.Row():
|
47 |
clear_button = gr.Button(value="Clear", interactive=True)
|
48 |
+
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
submit_button = gr.Button(
|
51 |
value="Submit", interactive=True, variant="primary"
|
52 |
)
|
53 |
+
|
54 |
+
caption_output = gr.Textbox(lines=1, label="VQA Output")
|
55 |
+
submit_button.click(
|
56 |
inference_chat,
|
57 |
[
|
58 |
image_input,
|
|
|
60 |
],
|
61 |
[caption_output],
|
62 |
)
|
63 |
+
clear_button.click(
|
64 |
+
lambda: ("", [], []),
|
65 |
+
[],
|
66 |
+
[chat_input, state],
|
67 |
+
queue=False,
|
68 |
+
)
|
69 |
+
chat_input.submit(
|
70 |
+
inference_chat,
|
71 |
+
[
|
72 |
+
image_input,
|
73 |
+
chat_input,
|
74 |
+
],
|
75 |
+
[ caption_output],
|
76 |
+
)
|
77 |
|
78 |
image_input.change(
|
79 |
lambda: ("", "", []),
|