Spaces:
Running
on
Zero
Running
on
Zero
Haozhangcx
commited on
Commit
β’
c38a744
1
Parent(s):
8ad5190
Update app.py
Browse files
app.py
CHANGED
@@ -220,37 +220,37 @@ with gr.Blocks() as demo:
|
|
220 |
]
|
221 |
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
222 |
gr.Markdown(title_markdown)
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
255 |
bot_msg = chat_msg.then(bot, chatbot, chatbot, api_name="bot_response")
|
256 |
bot_msg.then(lambda: gr.MultimodalTextbox(interactive=True), None, [chat_input])
|
|
|
220 |
]
|
221 |
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
222 |
gr.Markdown(title_markdown)
|
223 |
+
with gr.Row():
|
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 |
+
with gr.Row():
|
228 |
+
gr.Examples(examples=[
|
229 |
+
[{"files": [f"{cur_dir}/examples/code1.jpeg",f"{cur_dir}/examples/code2.jpeg"], "text": "Please pay attention to the movement of the object from the first image to the second image, then write a HTML code to show this movement."}],
|
230 |
+
[{"files": [f"{cur_dir}/examples/shub.jpg",f"{cur_dir}/examples/shuc.jpg",f"{cur_dir}/examples/shud.jpg"], "text": "what is fun about the images?"}],
|
231 |
+
[{"files": [f"{cur_dir}/examples/iphone-15-price-1024x576.jpg",f"{cur_dir}/examples/dynamic-island-1024x576.jpg",f"{cur_dir}/examples/iphone-15-colors-1024x576.jpg",f"{cur_dir}/examples/Iphone-15-Usb-c-charger-1024x576.jpg",f"{cur_dir}/examples/A-17-processors-1024x576.jpg"], "text": "The images are the PPT of iPhone 15 review. can you summarize the main information?"}],
|
232 |
+
[{"files": [f"{cur_dir}/examples/fangao3.jpeg",f"{cur_dir}/examples/fangao2.jpeg",f"{cur_dir}/examples/fangao1.jpeg"], "text": "Do you kown who draw these paintings?"}],
|
233 |
+
[{"files": [f"{cur_dir}/examples/oprah-winfrey-resume.png",f"{cur_dir}/examples/steve-jobs-resume.jpg"], "text": "Hi, there are two candidates, can you provide a brief description for each of them for me?"}],
|
234 |
+
[{"files": [f"{cur_dir}/examples/original_bench.jpeg",f"{cur_dir}/examples/changed_bench.jpeg"], "text": "How to edit image1 to make it look like image2?"}],
|
235 |
+
[{"files": [f"{cur_dir}/examples/twitter2.jpeg",f"{cur_dir}/examples/twitter3.jpeg",f"{cur_dir}/examples/twitter4.jpeg"], "text": "Please write a twitter blog post with the images."}],
|
236 |
+
# [{"files": [f"{cur_dir}/examples/twitter3.jpeg",f"{cur_dir}/examples/twitter4.jpeg"], "text": "Please write a twitter blog post with the images."}],
|
237 |
+
# [{"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?"}],
|
238 |
+
|
239 |
+
], inputs=[chat_input], label="Compare images: ",examples_per_page=3)
|
240 |
+
with gr.Column():
|
241 |
+
with gr.Row():
|
242 |
+
chatbot = gr.Chatbot(
|
243 |
+
[],
|
244 |
+
elem_id="chatbot",
|
245 |
+
bubble_full_width=False
|
246 |
+
)
|
247 |
+
with gr.Row():
|
248 |
+
upvote_btn = gr.Button(value="π Upvote", interactive=True)
|
249 |
+
downvote_btn = gr.Button(value="π Downvote", interactive=True)
|
250 |
+
flag_btn = gr.Button(value="β οΈ Flag", interactive=True)
|
251 |
+
#stop_btn = gr.Button(value="βΉοΈ Stop Generation", interactive=True)
|
252 |
+
regenerate_btn = gr.Button(value="π Regenerate", interactive=True)
|
253 |
+
clear_btn = gr.Button(value="ποΈ Clear history", interactive=True)
|
254 |
chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
|
255 |
bot_msg = chat_msg.then(bot, chatbot, chatbot, api_name="bot_response")
|
256 |
bot_msg.then(lambda: gr.MultimodalTextbox(interactive=True), None, [chat_input])
|