Spaces:
Running
on
Zero
Running
on
Zero
Commit
β’
b9d668e
1
Parent(s):
8384b0f
update audio case (#6)
Browse files- update audoi (d9b138fd4f1a348b180d1f4e3b5a68d206b4e05e)
Co-authored-by: yongxinzhu <zyx123@users.noreply.huggingface.co>
- app.py +10 -27
- examples/Y--ZHUMfueO0.flac +0 -0
- examples/{1034346401.mp4 β bird-twitter-car.wav} +2 -2
- examples/desert.jpg +0 -0
- examples/{Traffic and pedestrians.wav β door.of.bar.raining2.wav} +2 -2
- examples/extreme_ironing.jpg +0 -0
- examples/sample_demo_3.mp4 +0 -3
- examples/sample_demo_9.mp4 +0 -3
- examples/waterview.jpg +0 -0
app.py
CHANGED
@@ -97,8 +97,9 @@ class Chat:
|
|
97 |
|
98 |
|
99 |
@spaces.GPU(duration=120)
|
100 |
-
def generate(
|
101 |
data = []
|
|
|
102 |
|
103 |
processor = handler.processor
|
104 |
try:
|
@@ -182,7 +183,7 @@ def generate(image, video, audio, message, chatbot, va_tag, textbox_in, temperat
|
|
182 |
one_turn_chat[1] = text_en_out
|
183 |
chatbot.append(one_turn_chat)
|
184 |
|
185 |
-
return gr.update(value=
|
186 |
|
187 |
|
188 |
def regenerate(message, chatbot):
|
@@ -226,8 +227,6 @@ with gr.Blocks(title='VideoLLaMA 2 π₯ππ₯', theme=theme, css=block_css) as
|
|
226 |
|
227 |
with gr.Row():
|
228 |
with gr.Column(scale=3):
|
229 |
-
#image = gr.Image(label="Input Image", type="filepath")
|
230 |
-
image = None
|
231 |
video = gr.Video(label="Input Video")
|
232 |
audio = gr.Audio(label="Input Audio", type="filepath")
|
233 |
|
@@ -287,22 +286,6 @@ with gr.Blocks(title='VideoLLaMA 2 π₯ππ₯', theme=theme, css=block_css) as
|
|
287 |
|
288 |
with gr.Row():
|
289 |
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
290 |
-
'''
|
291 |
-
with gr.Column():
|
292 |
-
gr.Examples(
|
293 |
-
examples=[
|
294 |
-
[
|
295 |
-
f"{cur_dir}/examples/extreme_ironing.jpg",
|
296 |
-
"What happens in this image?",
|
297 |
-
],
|
298 |
-
[
|
299 |
-
f"{cur_dir}/examples/waterview.jpg",
|
300 |
-
"What are the things I should be cautious about when I visit here?",
|
301 |
-
],
|
302 |
-
],
|
303 |
-
inputs=[image, textbox],
|
304 |
-
)
|
305 |
-
'''
|
306 |
with gr.Column():
|
307 |
gr.Examples(
|
308 |
examples=[
|
@@ -336,11 +319,11 @@ with gr.Blocks(title='VideoLLaMA 2 π₯ππ₯', theme=theme, css=block_css) as
|
|
336 |
gr.Examples(
|
337 |
examples=[
|
338 |
[
|
339 |
-
f"{cur_dir}/examples/
|
340 |
"Please describe the audio.",
|
341 |
],
|
342 |
[
|
343 |
-
f"{cur_dir}/examples/
|
344 |
"Please describe the audio.",
|
345 |
],
|
346 |
],
|
@@ -352,20 +335,20 @@ with gr.Blocks(title='VideoLLaMA 2 π₯ππ₯', theme=theme, css=block_css) as
|
|
352 |
|
353 |
submit_btn.click(
|
354 |
generate,
|
355 |
-
[
|
356 |
-
[
|
357 |
|
358 |
regenerate_btn.click(
|
359 |
regenerate,
|
360 |
[message, chatbot],
|
361 |
[message, chatbot]).then(
|
362 |
generate,
|
363 |
-
[
|
364 |
-
[
|
365 |
|
366 |
clear_btn.click(
|
367 |
clear_history,
|
368 |
[message, chatbot],
|
369 |
-
[
|
370 |
|
371 |
demo.launch(share=False)
|
|
|
97 |
|
98 |
|
99 |
@spaces.GPU(duration=120)
|
100 |
+
def generate(video, audio, message, chatbot, va_tag, textbox_in, temperature, top_p, max_output_tokens, dtype=torch.float16):
|
101 |
data = []
|
102 |
+
image = None
|
103 |
|
104 |
processor = handler.processor
|
105 |
try:
|
|
|
183 |
one_turn_chat[1] = text_en_out
|
184 |
chatbot.append(one_turn_chat)
|
185 |
|
186 |
+
return gr.update(value=video, interactive=True), gr.update(value=audio, interactive=True), message, chatbot
|
187 |
|
188 |
|
189 |
def regenerate(message, chatbot):
|
|
|
227 |
|
228 |
with gr.Row():
|
229 |
with gr.Column(scale=3):
|
|
|
|
|
230 |
video = gr.Video(label="Input Video")
|
231 |
audio = gr.Audio(label="Input Audio", type="filepath")
|
232 |
|
|
|
286 |
|
287 |
with gr.Row():
|
288 |
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
with gr.Column():
|
290 |
gr.Examples(
|
291 |
examples=[
|
|
|
319 |
gr.Examples(
|
320 |
examples=[
|
321 |
[
|
322 |
+
f"{cur_dir}/examples/bird-twitter-car.wav",
|
323 |
"Please describe the audio.",
|
324 |
],
|
325 |
[
|
326 |
+
f"{cur_dir}/examples/door.of.bar.raining2.wav",
|
327 |
"Please describe the audio.",
|
328 |
],
|
329 |
],
|
|
|
335 |
|
336 |
submit_btn.click(
|
337 |
generate,
|
338 |
+
[video, audio, message, chatbot, va_tag, textbox, temperature, top_p, max_output_tokens],
|
339 |
+
[video, audio, message, chatbot])
|
340 |
|
341 |
regenerate_btn.click(
|
342 |
regenerate,
|
343 |
[message, chatbot],
|
344 |
[message, chatbot]).then(
|
345 |
generate,
|
346 |
+
[video, audio, message, chatbot, va_tag, textbox, temperature, top_p, max_output_tokens],
|
347 |
+
[video, audio, message, chatbot])
|
348 |
|
349 |
clear_btn.click(
|
350 |
clear_history,
|
351 |
[message, chatbot],
|
352 |
+
[video, audio, message, chatbot, textbox])
|
353 |
|
354 |
demo.launch(share=False)
|
examples/Y--ZHUMfueO0.flac
DELETED
Binary file (324 kB)
|
|
examples/{1034346401.mp4 β bird-twitter-car.wav}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a9d2287cf4fe2eec00c9c7c623df34cacdc3f2a0e91655db805b4871193fb680
|
3 |
+
size 2412098
|
examples/desert.jpg
DELETED
Binary file (881 kB)
|
|
examples/{Traffic and pedestrians.wav β door.of.bar.raining2.wav}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:535cab1a35770077b8ca31e6773ec5121b9ac6559430600821b2c747a944f7d2
|
3 |
+
size 1339018
|
examples/extreme_ironing.jpg
DELETED
Binary file (62.6 kB)
|
|
examples/sample_demo_3.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:da6126bce64c64a3d6f7ce889fbe15b5f1c2e3f978846351d8c7a79a950b429e
|
3 |
-
size 463547
|
|
|
|
|
|
|
|
examples/sample_demo_9.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:f9702694f185e27ae016b85024b367e140cf93a4e3124d072816fd32f2ca0d96
|
3 |
-
size 631864
|
|
|
|
|
|
|
|
examples/waterview.jpg
DELETED
Binary file (95.5 kB)
|
|