Spaces:
Sleeping
Sleeping
add spinner to load slip/clip
Browse files- 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 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
|
|
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 = []
|