Spaces:
Running
on
Zero
Running
on
Zero
Haozhangcx
commited on
Commit
β’
4d02823
1
Parent(s):
9fb5a36
Update app.py
Browse files
app.py
CHANGED
@@ -220,27 +220,8 @@ with gr.Blocks() as demo:
|
|
220 |
]
|
221 |
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
222 |
gr.Markdown(title_markdown)
|
223 |
-
with gr.Column():
|
224 |
-
chatbot = gr.Chatbot(
|
225 |
-
[],
|
226 |
-
elem_id="chatbot",
|
227 |
-
bubble_full_width=False
|
228 |
-
)
|
229 |
-
with gr.Column():
|
230 |
-
with gr.Row():
|
231 |
-
upvote_btn = gr.Button(value="π Upvote", interactive=True)
|
232 |
-
downvote_btn = gr.Button(value="π Downvote", interactive=True)
|
233 |
-
flag_btn = gr.Button(value="β οΈ Flag", interactive=True)
|
234 |
-
#stop_btn = gr.Button(value="βΉοΈ Stop Generation", interactive=True)
|
235 |
-
regenerate_btn = gr.Button(value="π Regenerate", interactive=True)
|
236 |
-
clear_btn = gr.Button(value="ποΈ Clear history", interactive=True)
|
237 |
-
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
238 |
-
bot_msg = chat_msg.then(bot, chatbot, chatbot, api_name="bot_response")
|
239 |
-
bot_msg.then(lambda: gr.MultimodalTextbox(interactive=True), None, [chat_input])
|
240 |
|
241 |
-
|
242 |
-
clear_btn.click(fn=clear_history, inputs=[chatbot], outputs=[chatbot], api_name="clear_all")
|
243 |
-
|
244 |
with gr.Row():
|
245 |
chat_input = gr.MultimodalTextbox(interactive=True, file_types=["image","video"], placeholder="Enter message or upload file...", show_label=False)
|
246 |
gr.Examples(examples=[
|
@@ -255,6 +236,25 @@ with gr.Blocks() as demo:
|
|
255 |
# [{"files": [f"playground/demo/examples/lion1_.mp4",f"playground/demo/examples/lion2_.mp4"], "text": "The input contains two videos, the first half is the first video and the second half is the second video. What is the difference between the two videos?"}],
|
256 |
|
257 |
], inputs=[chat_input], label="Compare images: ",examples_per_page=3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
|
259 |
|
260 |
|
|
|
220 |
]
|
221 |
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
222 |
gr.Markdown(title_markdown)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
|
224 |
+
with gr.Column():
|
|
|
|
|
225 |
with gr.Row():
|
226 |
chat_input = gr.MultimodalTextbox(interactive=True, file_types=["image","video"], placeholder="Enter message or upload file...", show_label=False)
|
227 |
gr.Examples(examples=[
|
|
|
236 |
# [{"files": [f"playground/demo/examples/lion1_.mp4",f"playground/demo/examples/lion2_.mp4"], "text": "The input contains two videos, the first half is the first video and the second half is the second video. What is the difference between the two videos?"}],
|
237 |
|
238 |
], inputs=[chat_input], label="Compare images: ",examples_per_page=3)
|
239 |
+
with gr.Column():
|
240 |
+
chatbot = gr.Chatbot(
|
241 |
+
[],
|
242 |
+
elem_id="chatbot",
|
243 |
+
bubble_full_width=False
|
244 |
+
)
|
245 |
+
with gr.Row():
|
246 |
+
upvote_btn = gr.Button(value="π Upvote", interactive=True)
|
247 |
+
downvote_btn = gr.Button(value="π Downvote", interactive=True)
|
248 |
+
flag_btn = gr.Button(value="β οΈ Flag", interactive=True)
|
249 |
+
#stop_btn = gr.Button(value="βΉοΈ Stop Generation", interactive=True)
|
250 |
+
regenerate_btn = gr.Button(value="π Regenerate", interactive=True)
|
251 |
+
clear_btn = gr.Button(value="ποΈ Clear history", interactive=True)
|
252 |
+
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
253 |
+
bot_msg = chat_msg.then(bot, chatbot, chatbot, api_name="bot_response")
|
254 |
+
bot_msg.then(lambda: gr.MultimodalTextbox(interactive=True), None, [chat_input])
|
255 |
+
|
256 |
+
chatbot.like(print_like_dislike, None, None)
|
257 |
+
clear_btn.click(fn=clear_history, inputs=[chatbot], outputs=[chatbot], api_name="clear_all")
|
258 |
|
259 |
|
260 |
|