Use consolidated embeddings
Browse files
backend/runner/inference.py
CHANGED
|
@@ -211,8 +211,14 @@ def _initialize_pipeline():
|
|
| 211 |
|
| 212 |
model = model.eval()
|
| 213 |
|
| 214 |
-
# Load pre-computed embeddings
|
| 215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
|
| 217 |
# Load sentence metadata
|
| 218 |
sentences_data = _load_sentences_metadata(SENTENCES_JSON)
|
|
|
|
| 211 |
|
| 212 |
model = model.eval()
|
| 213 |
|
| 214 |
+
# Load pre-computed embeddings - USE CONSOLIDATED LOADING
|
| 215 |
+
if MODEL_TYPE == "clip":
|
| 216 |
+
embeddings, sentence_ids = load_embeddings_for_model("clip")
|
| 217 |
+
else:
|
| 218 |
+
embeddings, sentence_ids = load_embeddings_for_model("paintingclip")
|
| 219 |
+
|
| 220 |
+
if embeddings is None or sentence_ids is None:
|
| 221 |
+
raise ValueError(f"Failed to load embeddings for model type: {MODEL_TYPE}")
|
| 222 |
|
| 223 |
# Load sentence metadata
|
| 224 |
sentences_data = _load_sentences_metadata(SENTENCES_JSON)
|