Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -86,13 +86,15 @@ vis_processor = registry.get_processor_class(vis_processor_cfg.name).from_config
|
|
| 86 |
chat = Chat(model, vis_processor, device='cuda')
|
| 87 |
print('Initialization Finished')
|
| 88 |
|
| 89 |
-
|
|
|
|
| 90 |
# ========================================
|
| 91 |
# Gradio Setting
|
| 92 |
# ========================================
|
| 93 |
|
| 94 |
|
| 95 |
def gradio_reset(chat_state, img_list):
|
|
|
|
| 96 |
have_video = 0
|
| 97 |
if chat_state is not None:
|
| 98 |
chat_state.messages = []
|
|
@@ -135,6 +137,7 @@ def gradio_ask(user_message, chatbot, chat_state):
|
|
| 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
|
|
|
|
| 86 |
chat = Chat(model, vis_processor, device='cuda')
|
| 87 |
print('Initialization Finished')
|
| 88 |
|
| 89 |
+
have_video = 0
|
| 90 |
+
|
| 91 |
# ========================================
|
| 92 |
# Gradio Setting
|
| 93 |
# ========================================
|
| 94 |
|
| 95 |
|
| 96 |
def gradio_reset(chat_state, img_list):
|
| 97 |
+
global have_video
|
| 98 |
have_video = 0
|
| 99 |
if chat_state is not None:
|
| 100 |
chat_state.messages = []
|
|
|
|
| 137 |
|
| 138 |
@spaces.GPU
|
| 139 |
def gradio_answer(video, chatbot, chat_state, img_list, num_beams, temperature):
|
| 140 |
+
global have_video
|
| 141 |
if have_video == 0:
|
| 142 |
llm_message = chat.upload_video_without_audio(video, chat_state, img_list)
|
| 143 |
have_video = 1
|