Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -57,11 +57,13 @@ with gr.Blocks() as demo:
|
|
57 |
@spaces.GPU
|
58 |
def gr_chatinterface_fn(message, history, state, video_path, mode):
|
59 |
global infer
|
|
|
60 |
if infer is None:
|
61 |
infer = _init_infer()
|
62 |
state['video_path'] = video_path
|
|
|
63 |
if mode == 'Conversation':
|
64 |
-
|
65 |
else:
|
66 |
return 'waiting video input...'
|
67 |
def gr_chatinterface_chatbot_clear_fn():
|
|
|
57 |
@spaces.GPU
|
58 |
def gr_chatinterface_fn(message, history, state, video_path, mode):
|
59 |
global infer
|
60 |
+
yield 'initializing model, thanks for waiting...', state
|
61 |
if infer is None:
|
62 |
infer = _init_infer()
|
63 |
state['video_path'] = video_path
|
64 |
+
yield 'finished initialization, responding...', state
|
65 |
if mode == 'Conversation':
|
66 |
+
yield infer.video_qa(query=message, state=state)
|
67 |
else:
|
68 |
return 'waiting video input...'
|
69 |
def gr_chatinterface_chatbot_clear_fn():
|