Spaces:
Sleeping
Sleeping
Bellok
commited on
Commit
·
424ee90
1
Parent(s):
914f7c2
feat(query): update confidence threshold and enhance debug logging
Browse filesAdjust confidence threshold from 0.1 to 0.3 in query_warbler function to restore normal threshold now that real HF data might be available. Enhance debug output to include top 3 relevance scores, threshold values, and no-results info for better troubleshooting.
app.py
CHANGED
|
@@ -207,7 +207,7 @@ def query_warbler(query_text: str, max_results: int = 5, use_hybrid: bool = True
|
|
| 207 |
semantic_query=query_text,
|
| 208 |
max_results=max_results,
|
| 209 |
fractalstat_hybrid=use_hybrid, # Full hybrid mode when user enables it
|
| 210 |
-
confidence_threshold=0.
|
| 211 |
)
|
| 212 |
|
| 213 |
# DEBUG: Log query details
|
|
@@ -218,8 +218,13 @@ def query_warbler(query_text: str, max_results: int = 5, use_hybrid: bool = True
|
|
| 218 |
|
| 219 |
elapsed_ms = (time.time() - start_time) * 1000
|
| 220 |
|
| 221 |
-
# DEBUG: Log results summary
|
| 222 |
print(f"DEBUG: Query completed in {elapsed_ms:.0f}ms, found {len(assembly.results)} results")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
|
| 224 |
# Format results
|
| 225 |
output = f"## Query Results\n\n"
|
|
|
|
| 207 |
semantic_query=query_text,
|
| 208 |
max_results=max_results,
|
| 209 |
fractalstat_hybrid=use_hybrid, # Full hybrid mode when user enables it
|
| 210 |
+
confidence_threshold=0.3 # Restore normal threshold now that we might have real HF data
|
| 211 |
)
|
| 212 |
|
| 213 |
# DEBUG: Log query details
|
|
|
|
| 218 |
|
| 219 |
elapsed_ms = (time.time() - start_time) * 1000
|
| 220 |
|
| 221 |
+
# DEBUG: Log results summary with details
|
| 222 |
print(f"DEBUG: Query completed in {elapsed_ms:.0f}ms, found {len(assembly.results)} results")
|
| 223 |
+
if assembly.results:
|
| 224 |
+
print(f"DEBUG: Top 3 relevance scores: {[r.relevance_score for r in assembly.results[:3]]}")
|
| 225 |
+
print(f"DEBUG: Confidence threshold was: {query.confidence_threshold}")
|
| 226 |
+
else:
|
| 227 |
+
print(f"DEBUG: No results above threshold: {query.confidence_threshold}")
|
| 228 |
|
| 229 |
# Format results
|
| 230 |
output = f"## Query Results\n\n"
|