Update app.py
Browse files
app.py
CHANGED
|
@@ -65,35 +65,35 @@ with gr.Blocks(title='Asking questions about imagesπ') as demo:
|
|
| 65 |
inputs=[image1, textbox],
|
| 66 |
)
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
|
| 88 |
-
#
|
| 89 |
-
#
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
|
| 98 |
-
|
| 99 |
demo.launch()
|
|
|
|
| 65 |
inputs=[image1, textbox],
|
| 66 |
)
|
| 67 |
|
| 68 |
+
with gr.Column(scale=7):
|
| 69 |
+
#chatbot = gr.Chatbot(label="MoE-LLaVA", bubble_full_width=True).style(height=750)
|
| 70 |
+
with gr.Row():
|
| 71 |
+
with gr.Column(scale=8):
|
| 72 |
+
textbox.render()
|
| 73 |
+
with gr.Column(scale=1, min_width=50):
|
| 74 |
+
submit_btn = gr.Button(
|
| 75 |
+
value="Send", variant="primary", interactive=True
|
| 76 |
+
)
|
| 77 |
+
with gr.Row(elem_id="buttons") as button_row:
|
| 78 |
+
upvote_btn = gr.Button(value="π Upvote", interactive=True)
|
| 79 |
+
downvote_btn = gr.Button(value="π Downvote", interactive=True)
|
| 80 |
+
flag_btn = gr.Button(value="β οΈ Flag", interactive=True)
|
| 81 |
+
# stop_btn = gr.Button(value="βΉοΈ Stop Generation", interactive=False)
|
| 82 |
+
regenerate_btn = gr.Button(value="π Regenerate", interactive=True)
|
| 83 |
+
clear_btn = gr.Button(value="ποΈ Clear history", interactive=True)
|
| 84 |
|
| 85 |
+
gr.Markdown(tos_markdown)
|
| 86 |
+
gr.Markdown(learn_more_markdown)
|
| 87 |
|
| 88 |
+
#submit_btn.click(generate, [image1, textbox, first_run, state, state_, images_tensor],
|
| 89 |
+
# [state, state_, chatbot, first_run, textbox, images_tensor, image1])
|
| 90 |
|
| 91 |
+
regenerate_btn.click(regenerate, [state, state_], [state, state_, chatbot, first_run]).then(
|
| 92 |
+
generate, [image1, textbox, first_run, state, state_, images_tensor],
|
| 93 |
+
[state, state_, chatbot, first_run, textbox, images_tensor, image1])
|
| 94 |
|
| 95 |
+
clear_btn.click(clear_history, [state, state_],
|
| 96 |
+
[image1, textbox, first_run, state, state_, chatbot, images_tensor])
|
| 97 |
|
| 98 |
+
app = gr.mount_gradio_app(app, demo, path="/")
|
| 99 |
demo.launch()
|