Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -90,8 +90,10 @@ print('Initialization Finished')
|
|
90 |
# Gradio Setting
|
91 |
# ========================================
|
92 |
|
|
|
93 |
|
94 |
def gradio_reset(chat_state, img_list):
|
|
|
95 |
if chat_state is not None:
|
96 |
chat_state.messages = []
|
97 |
if img_list is not None:
|
@@ -133,7 +135,9 @@ def gradio_ask(user_message, chatbot, chat_state):
|
|
133 |
|
134 |
@spaces.GPU
|
135 |
def gradio_answer(video, chatbot, chat_state, img_list, num_beams, temperature):
|
136 |
-
|
|
|
|
|
137 |
llm_message = chat.answer(conv=chat_state,
|
138 |
img_list=img_list,
|
139 |
num_beams=num_beams,
|
|
|
90 |
# Gradio Setting
|
91 |
# ========================================
|
92 |
|
93 |
+
have_video = 0
|
94 |
|
95 |
def gradio_reset(chat_state, img_list):
|
96 |
+
have_video = 0
|
97 |
if chat_state is not None:
|
98 |
chat_state.messages = []
|
99 |
if img_list is not None:
|
|
|
135 |
|
136 |
@spaces.GPU
|
137 |
def gradio_answer(video, chatbot, chat_state, img_list, num_beams, temperature):
|
138 |
+
if have_video == 0:
|
139 |
+
llm_message = chat.upload_video_without_audio(video, chat_state, img_list)
|
140 |
+
have_video = 1
|
141 |
llm_message = chat.answer(conv=chat_state,
|
142 |
img_list=img_list,
|
143 |
num_beams=num_beams,
|