Jiaqi-hkust commited on
Commit
7858048
·
verified ·
1 Parent(s): f39c483

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
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
- llm_message = chat.upload_video_without_audio(video, chat_state, img_list)
 
 
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,