ncoria commited on
Commit
1621356
·
verified ·
1 Parent(s): 3f0e895

add spinner to load slip/clip

Browse files
Files changed (1) hide show
  1. utils/utils.py +7 -6
utils/utils.py CHANGED
@@ -176,12 +176,13 @@ def generate_embeddings_stream_io(uploaded_files : list,
176
  # set up model and device
177
  device = "cuda" if torch.cuda.is_available() else "cpu"
178
  os.environ['CUDA_VISIBLE_DEVICES'] = '0'
179
- if model == 'SLIP':
180
- embed_model = load_slip_model(device)
181
- processor = load_slip_preprocessor()
182
- elif model == 'CLIP':
183
- embed_model = load_clip_model(device)
184
- processor = load_clip_preprocessor()
 
185
 
186
  all_video_embeddings = []
187
  all_video_frames = []
 
176
  # set up model and device
177
  device = "cuda" if torch.cuda.is_available() else "cpu"
178
  os.environ['CUDA_VISIBLE_DEVICES'] = '0'
179
+ with st.spinner('Loading multimodal model...'):
180
+ if model == 'SLIP':
181
+ embed_model = load_slip_model(device)
182
+ processor = load_slip_preprocessor()
183
+ elif model == 'CLIP':
184
+ embed_model = load_clip_model(device)
185
+ processor = load_clip_preprocessor()
186
 
187
  all_video_embeddings = []
188
  all_video_frames = []