Spaces:
Running on Zero
Running on Zero
sync: from ael backend/space/
Browse files
rerank.py
CHANGED
|
@@ -207,6 +207,12 @@ def rerank(query, results, budget_ms=800):
|
|
| 207 |
return out
|
| 208 |
router = _get_router()
|
| 209 |
if router is None:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
return out
|
| 211 |
|
| 212 |
t0 = time.time()
|
|
|
|
| 207 |
return out
|
| 208 |
router = _get_router()
|
| 209 |
if router is None:
|
| 210 |
+
# Recomputed here, not reused from above: `_no_opinion()` reads
|
| 211 |
+
# `_load_error`, and until this line nothing had *tried* to load the
|
| 212 |
+
# model, so the value captured in `out` was always None on exactly the
|
| 213 |
+
# path that needed it. The first version of this reported "no opinion"
|
| 214 |
+
# for a reranker that had never once been installed.
|
| 215 |
+
out["no_opinion"] = _no_opinion()
|
| 216 |
return out
|
| 217 |
|
| 218 |
t0 = time.time()
|