VaianiLorenzo
commited on
Commit
·
89e64c9
1
Parent(s):
6640fa0
Update app.py
Browse files
app.py
CHANGED
@@ -259,7 +259,7 @@ def draw_text(
|
|
259 |
if 'model' not in st.session_state:
|
260 |
#with st.spinner('We are orginizing your traks...'):
|
261 |
text_encoder = AutoModel.from_pretrained(CLIP_TEXT_MODEL_PATH, local_files_only=True)
|
262 |
-
vision_encoder = CLIPVisionModel.from_pretrained(CLIP_VISION_MODEL_PATH, local_files_only=True)
|
263 |
tokenizer = AutoTokenizer.from_pretrained(TEXT_MODEL)
|
264 |
model = CLIPDemo(vision_encoder=vision_encoder, text_encoder=text_encoder, tokenizer=tokenizer, device=device)
|
265 |
model.compute_image_embeddings(glob.glob(SPECTROGRAMS_PATH + "/*.jpeg")[:1000])
|
@@ -313,7 +313,7 @@ def draw_audio(
|
|
313 |
if 'model' not in st.session_state:
|
314 |
#with st.spinner('We are orginizing your traks...'):
|
315 |
text_encoder = AutoModel.from_pretrained(CLIP_TEXT_MODEL_PATH, local_files_only=True)
|
316 |
-
vision_encoder = CLIPVisionModel.from_pretrained(CLIP_VISION_MODEL_PATH, local_files_only=True)
|
317 |
tokenizer = AutoTokenizer.from_pretrained(TEXT_MODEL)
|
318 |
model = CLIPDemo(vision_encoder=vision_encoder, text_encoder=text_encoder, tokenizer=tokenizer, device=device)
|
319 |
model.compute_image_embeddings(glob.glob(SPECTROGRAMS_PATH+"/*.jpeg")[:5000])
|
@@ -381,7 +381,7 @@ def draw_camera(
|
|
381 |
if 'model' not in st.session_state:
|
382 |
#with st.spinner('We are orginizing your traks...'):
|
383 |
text_encoder = AutoModel.from_pretrained(CLIP_TEXT_MODEL_PATH, local_files_only=True)
|
384 |
-
vision_encoder = CLIPVisionModel.from_pretrained(CLIP_VISION_MODEL_PATH, local_files_only=True)
|
385 |
tokenizer = AutoTokenizer.from_pretrained(TEXT_MODEL)
|
386 |
model = CLIPDemo(vision_encoder=vision_encoder, text_encoder=text_encoder, tokenizer=tokenizer, device=device)
|
387 |
model.compute_image_embeddings(glob.glob(SPECTROGRAMS_PATH + "/*.jpeg")[:5000])
|
|
|
259 |
if 'model' not in st.session_state:
|
260 |
#with st.spinner('We are orginizing your traks...'):
|
261 |
text_encoder = AutoModel.from_pretrained(CLIP_TEXT_MODEL_PATH, local_files_only=True)
|
262 |
+
vision_encoder = CLIPVisionModel.from_pretrained(CLIP_VISION_MODEL_PATH, local_files_only=True).to(device)
|
263 |
tokenizer = AutoTokenizer.from_pretrained(TEXT_MODEL)
|
264 |
model = CLIPDemo(vision_encoder=vision_encoder, text_encoder=text_encoder, tokenizer=tokenizer, device=device)
|
265 |
model.compute_image_embeddings(glob.glob(SPECTROGRAMS_PATH + "/*.jpeg")[:1000])
|
|
|
313 |
if 'model' not in st.session_state:
|
314 |
#with st.spinner('We are orginizing your traks...'):
|
315 |
text_encoder = AutoModel.from_pretrained(CLIP_TEXT_MODEL_PATH, local_files_only=True)
|
316 |
+
vision_encoder = CLIPVisionModel.from_pretrained(CLIP_VISION_MODEL_PATH, local_files_only=True).to(device)
|
317 |
tokenizer = AutoTokenizer.from_pretrained(TEXT_MODEL)
|
318 |
model = CLIPDemo(vision_encoder=vision_encoder, text_encoder=text_encoder, tokenizer=tokenizer, device=device)
|
319 |
model.compute_image_embeddings(glob.glob(SPECTROGRAMS_PATH+"/*.jpeg")[:5000])
|
|
|
381 |
if 'model' not in st.session_state:
|
382 |
#with st.spinner('We are orginizing your traks...'):
|
383 |
text_encoder = AutoModel.from_pretrained(CLIP_TEXT_MODEL_PATH, local_files_only=True)
|
384 |
+
vision_encoder = CLIPVisionModel.from_pretrained(CLIP_VISION_MODEL_PATH, local_files_only=True).to(device)
|
385 |
tokenizer = AutoTokenizer.from_pretrained(TEXT_MODEL)
|
386 |
model = CLIPDemo(vision_encoder=vision_encoder, text_encoder=text_encoder, tokenizer=tokenizer, device=device)
|
387 |
model.compute_image_embeddings(glob.glob(SPECTROGRAMS_PATH + "/*.jpeg")[:5000])
|