Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -88,7 +88,7 @@ with gr.Blocks() as demo:
|
|
88 |
)
|
89 |
gr_chatinterface.chatbot.clear(fn=gr_chatinterface_chatbot_clear_fn, inputs=[gr_dynamic_trigger], outputs=[gr_video_state, gr_state, gr_static_trigger, gr_dynamic_trigger])
|
90 |
gr_clean_button.click(fn=lambda :[[], *gr_chatinterface_chatbot_clear_fn()], inputs=[gr_dynamic_trigger], outputs=[gr_video_state, gr_state, gr_static_trigger, gr_dynamic_trigger])
|
91 |
-
|
92 |
@spaces.GPU
|
93 |
def gr_for_streaming(history: list[gr.ChatMessage], video_state: dict, state: dict, mode: str, static_trigger: int, dynamic_trigger: int):
|
94 |
if static_trigger == 0:
|
@@ -96,9 +96,9 @@ with gr.Blocks() as demo:
|
|
96 |
return
|
97 |
global gradio_backend
|
98 |
if gradio_backend is None:
|
99 |
-
yield '(ZeroGPU needs to initialize model under @spaces.GPU, thanks for waiting...)', state
|
100 |
gradio_backend = GradioBackend()
|
101 |
-
yield '(finished initialization, responding...)', state
|
102 |
waiting_prompt = 'Loading video now... thanks for waiting...'
|
103 |
yield history + [gr.ChatMessage(role="assistant", content=waiting_prompt)], state, dynamic_trigger
|
104 |
if not js_monitor:
|
|
|
88 |
)
|
89 |
gr_chatinterface.chatbot.clear(fn=gr_chatinterface_chatbot_clear_fn, inputs=[gr_dynamic_trigger], outputs=[gr_video_state, gr_state, gr_static_trigger, gr_dynamic_trigger])
|
90 |
gr_clean_button.click(fn=lambda :[[], *gr_chatinterface_chatbot_clear_fn()], inputs=[gr_dynamic_trigger], outputs=[gr_video_state, gr_state, gr_static_trigger, gr_dynamic_trigger])
|
91 |
+
|
92 |
@spaces.GPU
|
93 |
def gr_for_streaming(history: list[gr.ChatMessage], video_state: dict, state: dict, mode: str, static_trigger: int, dynamic_trigger: int):
|
94 |
if static_trigger == 0:
|
|
|
96 |
return
|
97 |
global gradio_backend
|
98 |
if gradio_backend is None:
|
99 |
+
yield '(ZeroGPU needs to initialize model under @spaces.GPU, thanks for waiting...)', state, dynamic_trigger
|
100 |
gradio_backend = GradioBackend()
|
101 |
+
yield '(finished initialization, responding...)', state, dynamic_trigger
|
102 |
waiting_prompt = 'Loading video now... thanks for waiting...'
|
103 |
yield history + [gr.ChatMessage(role="assistant", content=waiting_prompt)], state, dynamic_trigger
|
104 |
if not js_monitor:
|