csuhan commited on
Commit
dbc767d
·
1 Parent(s): c3bb7fb

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +9 -19
app.py CHANGED
@@ -184,22 +184,12 @@ def gradio_worker(
184
  msg = ""
185
  return chatbot, msg
186
 
187
- def change_modality(tab):
188
- modality = 'image'
189
- label_modal_dict = {
190
- 'Image': 'image',
191
- 'Video': 'video',
192
- 'Audio': 'audio',
193
- 'Point Cloud': 'point',
194
- 'IMU': 'imu',
195
- 'fMRI': 'fmri',
196
- 'Depth Map': 'rgbd',
197
- 'Normal Map': 'rgbn'
198
- }
199
- print(tab.label)
200
- if tab.label in label_modal_dict:
201
- modality = label_modal_dict[tab.label]
202
- return modality
203
 
204
  CSS ="""
205
  .contain { display: flex; flex-direction: column; }
@@ -247,9 +237,9 @@ def gradio_worker(
247
  label="Top-p",
248
  )
249
 
250
- img_tab.select(change_modality, [img_tab], [modality])
251
- video_tab.select(change_modality, [video_tab], [modality])
252
- audio_tab.select(change_modality, [audio_tab], [modality])
253
 
254
  msg.submit(
255
  show_user_input, [msg, chatbot], [msg, chatbot],
 
184
  msg = ""
185
  return chatbot, msg
186
 
187
+ def change_modality_image():
188
+ return 'image'
189
+ def change_modality_video():
190
+ return 'video'
191
+ def change_modality_audio():
192
+ return 'audio'
 
 
 
 
 
 
 
 
 
 
193
 
194
  CSS ="""
195
  .contain { display: flex; flex-direction: column; }
 
237
  label="Top-p",
238
  )
239
 
240
+ img_tab.select(change_modality_image, [], [modality])
241
+ video_tab.select(change_modality_video, [], [modality])
242
+ audio_tab.select(change_modality_audio, [], [modality])
243
 
244
  msg.submit(
245
  show_user_input, [msg, chatbot], [msg, chatbot],