Upload backend/core/search_ml.py with huggingface_hub
Browse files
backend/core/search_ml.py
CHANGED
|
@@ -167,12 +167,7 @@ def search_with_ml(
|
|
| 167 |
vector_weight=config.vector_weight
|
| 168 |
)
|
| 169 |
except Exception as e:
|
| 170 |
-
|
| 171 |
-
# Don't print full traceback for known compatibility issues
|
| 172 |
-
if "modeling_layers" in error_msg or "trainer" in error_msg:
|
| 173 |
-
print(f"Hybrid search not available (transformers compatibility issue), using BM25/TF-IDF", flush=True)
|
| 174 |
-
else:
|
| 175 |
-
print(f"Hybrid search not available, using BM25/TF-IDF: {error_msg}", flush=True)
|
| 176 |
|
| 177 |
# Attempt PostgreSQL BM25 ranking first when available
|
| 178 |
if connection.vendor == "postgresql" and hasattr(queryset.model, "tsv_body"):
|
|
|
|
| 167 |
vector_weight=config.vector_weight
|
| 168 |
)
|
| 169 |
except Exception as e:
|
| 170 |
+
print(f"Hybrid search not available, using BM25/TF-IDF: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
|
| 172 |
# Attempt PostgreSQL BM25 ranking first when available
|
| 173 |
if connection.vendor == "postgresql" and hasattr(queryset.model, "tsv_body"):
|