Spaces:
Running
Running
change -> input
Browse files
app.py
CHANGED
@@ -70,7 +70,7 @@ with gr.Blocks(title="VideoLLM-online", css=css) as demo:
|
|
70 |
gr_video_time = gr.Number(value=0, visible=False)
|
71 |
gr_liveinfer_queue_refresher = gr.Number(value=False, visible=False)
|
72 |
|
73 |
-
def
|
74 |
name, ext = os.path.splitext(src_video_path)
|
75 |
ffmpeg_video_path = os.path.join('demo/assets/cache', name + f'_{liveinfer.frame_fps}fps_{liveinfer.frame_resolution}' + ext)
|
76 |
if not os.path.exists(ffmpeg_video_path):
|
@@ -83,8 +83,8 @@ with gr.Blocks(title="VideoLLM-online", css=css) as demo:
|
|
83 |
if query or response:
|
84 |
history.append((query, response))
|
85 |
return history, video_time + 1 / liveinfer.frame_fps, not gate
|
86 |
-
gr_video.
|
87 |
-
|
88 |
outputs=[gr_chat_interface.chatbot, gr_video_time, gr_liveinfer_queue_refresher]
|
89 |
)
|
90 |
|
|
|
70 |
gr_video_time = gr.Number(value=0, visible=False)
|
71 |
gr_liveinfer_queue_refresher = gr.Number(value=False, visible=False)
|
72 |
|
73 |
+
def gr_video_input(src_video_path, history, video_time, gate):
|
74 |
name, ext = os.path.splitext(src_video_path)
|
75 |
ffmpeg_video_path = os.path.join('demo/assets/cache', name + f'_{liveinfer.frame_fps}fps_{liveinfer.frame_resolution}' + ext)
|
76 |
if not os.path.exists(ffmpeg_video_path):
|
|
|
83 |
if query or response:
|
84 |
history.append((query, response))
|
85 |
return history, video_time + 1 / liveinfer.frame_fps, not gate
|
86 |
+
gr_video.input(
|
87 |
+
gr_video_input, inputs=[gr_video, gr_chat_interface.chatbot, gr_video_time, gr_liveinfer_queue_refresher],
|
88 |
outputs=[gr_chat_interface.chatbot, gr_video_time, gr_liveinfer_queue_refresher]
|
89 |
)
|
90 |
|