lixin4ever CircleRadon commited on
Commit
49f4b5a
·
verified ·
1 Parent(s): c03cca7

Update example demos (#5)

Browse files

- Update example demos (ab6b04f556e0c51085fa65cb8d4c028e0d11b82e)


Co-authored-by: YuqianYuan <[email protected]>

Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -18,6 +18,7 @@ HEADER = ("""
18
  <h5 style="margin: 0;">If this demo please you, please give us a star ⭐ on Github or 💖 on this space.</h5>
19
  </div>
20
  </div>
 
21
  <div style="display: flex; justify-content: center; margin-top: 10px;">
22
  <a href="https://github.com/DAMO-NLP-SG/VideoLLaMA3"><img src='https://img.shields.io/badge/Github-VideoLLaMA3-9C276A' style="margin-right: 5px;"></a>
23
  <a href="https://arxiv.org/pdf/2501.13106"><img src="https://img.shields.io/badge/Arxiv-2501.13106-AD1C18" style="margin-right: 5px;"></a>
@@ -136,7 +137,7 @@ def _predict(messages, input_text, do_sample, temperature, top_p, max_new_tokens
136
  with gr.Blocks() as interface:
137
  gr.Markdown(HEADER)
138
  with gr.Row():
139
- chatbot = gr.Chatbot(type="messages", elem_id="chatbot", height=710)
140
 
141
  with gr.Column():
142
  with gr.Tab(label="Input"):
@@ -144,14 +145,14 @@ with gr.Blocks() as interface:
144
  with gr.Row():
145
  input_video = gr.Video(sources=["upload"], label="Upload Video")
146
  input_image = gr.Image(sources=["upload"], type="filepath", label="Upload Image")
147
-
148
- if len(image_examples):
149
- gr.Examples(image_examples, inputs=[input_image], label="Example Images")
150
- if len(video_examples):
151
- gr.Examples(video_examples, inputs=[input_video], label="Example Videos")
152
-
153
  input_text = gr.Textbox(label="Input Text", placeholder="Type your message here and press enter to submit")
154
 
 
 
 
 
 
 
155
  submit_button = gr.Button("Generate")
156
 
157
  with gr.Tab(label="Configure"):
@@ -179,4 +180,4 @@ with gr.Blocks() as interface:
179
 
180
 
181
  if __name__ == "__main__":
182
- interface.launch()
 
18
  <h5 style="margin: 0;">If this demo please you, please give us a star ⭐ on Github or 💖 on this space.</h5>
19
  </div>
20
  </div>
21
+
22
  <div style="display: flex; justify-content: center; margin-top: 10px;">
23
  <a href="https://github.com/DAMO-NLP-SG/VideoLLaMA3"><img src='https://img.shields.io/badge/Github-VideoLLaMA3-9C276A' style="margin-right: 5px;"></a>
24
  <a href="https://arxiv.org/pdf/2501.13106"><img src="https://img.shields.io/badge/Arxiv-2501.13106-AD1C18" style="margin-right: 5px;"></a>
 
137
  with gr.Blocks() as interface:
138
  gr.Markdown(HEADER)
139
  with gr.Row():
140
+ chatbot = gr.Chatbot(type="messages", elem_id="chatbot", height=780)
141
 
142
  with gr.Column():
143
  with gr.Tab(label="Input"):
 
145
  with gr.Row():
146
  input_video = gr.Video(sources=["upload"], label="Upload Video")
147
  input_image = gr.Image(sources=["upload"], type="filepath", label="Upload Image")
 
 
 
 
 
 
148
  input_text = gr.Textbox(label="Input Text", placeholder="Type your message here and press enter to submit")
149
 
150
+ gr.Examples(examples=[
151
+ [f"examples/bear.mp4", "What is unusual in the video?"],
152
+ [f"examples/dog.mp4", "Please describe the video in detail."],
153
+ [f"examples/running.mp4", "Who won the competition?"],
154
+ ], inputs=[input_video, input_text], label="Video examples")
155
+
156
  submit_button = gr.Button("Generate")
157
 
158
  with gr.Tab(label="Configure"):
 
180
 
181
 
182
  if __name__ == "__main__":
183
+ interface.launch(server_port=8012)