Spaces:
Runtime error
Runtime error
farrosalferro24
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -167,7 +167,8 @@ def bot(history, topk=None):
|
|
167 |
for _output in response[0]:
|
168 |
history[-1][1] = _output
|
169 |
time.sleep(0.05)
|
170 |
-
yield history, print_kw, patches_fig, topk_patches_fig
|
|
|
171 |
|
172 |
def plot_patches(inputs):
|
173 |
pixel_value = inputs.pixel_values[0].cpu().numpy()
|
@@ -234,9 +235,9 @@ def build_demo():
|
|
234 |
chat_input = gr.MultimodalTextbox(interactive=True, file_types=["image"], placeholder="Enter message or upload images. Please use <image> to indicate the position of uploaded images", show_label=True)
|
235 |
|
236 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
237 |
-
print_kw = gr.Textbox(label="keywords")
|
238 |
-
depict_patches = gr.Plot(label="image patches", format="png")
|
239 |
-
depict_topk_patches = gr.Plot(label="top-k image patches", format="png")
|
240 |
|
241 |
|
242 |
# with gr.Accordion(label='Advanced options', open=False):
|
@@ -278,7 +279,8 @@ def build_demo():
|
|
278 |
).then(
|
279 |
bot,
|
280 |
[chatbot, topk],
|
281 |
-
[chatbot, print_kw, depict_patches, depict_topk_patches], api_name="bot_response"
|
|
|
282 |
)
|
283 |
|
284 |
gr.Examples(
|
|
|
167 |
for _output in response[0]:
|
168 |
history[-1][1] = _output
|
169 |
time.sleep(0.05)
|
170 |
+
# yield history, print_kw, patches_fig, topk_patches_fig
|
171 |
+
history
|
172 |
|
173 |
def plot_patches(inputs):
|
174 |
pixel_value = inputs.pixel_values[0].cpu().numpy()
|
|
|
235 |
chat_input = gr.MultimodalTextbox(interactive=True, file_types=["image"], placeholder="Enter message or upload images. Please use <image> to indicate the position of uploaded images", show_label=True)
|
236 |
|
237 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
238 |
+
# print_kw = gr.Textbox(label="keywords")
|
239 |
+
# depict_patches = gr.Plot(label="image patches", format="png")
|
240 |
+
# depict_topk_patches = gr.Plot(label="top-k image patches", format="png")
|
241 |
|
242 |
|
243 |
# with gr.Accordion(label='Advanced options', open=False):
|
|
|
279 |
).then(
|
280 |
bot,
|
281 |
[chatbot, topk],
|
282 |
+
# [chatbot, print_kw, depict_patches, depict_topk_patches], api_name="bot_response"
|
283 |
+
chatbot
|
284 |
)
|
285 |
|
286 |
gr.Examples(
|