Spaces:
Sleeping
Sleeping
Commit ·
decdb15
1
Parent(s): 84acb35
fix: ColBERT dense fallback and increase Nginx proxy timeouts to 300s
Browse files
RAG_FULL_APPLICATION_BACKEND/app/techniques/colbert.py
CHANGED
|
@@ -27,8 +27,11 @@ class ColBERT(BaseRAGTechnique):
|
|
| 27 |
token_rows = await self.supabase.get_colbert_tokens(document_id)
|
| 28 |
|
| 29 |
if not token_rows:
|
| 30 |
-
await self.emit("
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# Group tokens by chunk_id
|
| 34 |
chunk_token_map = {}
|
|
|
|
| 27 |
token_rows = await self.supabase.get_colbert_tokens(document_id)
|
| 28 |
|
| 29 |
if not token_rows:
|
| 30 |
+
await self.emit("FALLBACK", "#F59E0B", "No ColBERT token index found. Falling back to dense vector search...")
|
| 31 |
+
q_vec = get_embedding(query)
|
| 32 |
+
results = await self.supabase.vector_search(q_vec, document_id, self.user_id, top_k)
|
| 33 |
+
await self.emit("DONE", "#22C55E", f"Vector search fallback complete. top-{top_k} returned.")
|
| 34 |
+
return results
|
| 35 |
|
| 36 |
# Group tokens by chunk_id
|
| 37 |
chunk_token_map = {}
|
nginx/nginx.conf
CHANGED
|
@@ -17,6 +17,9 @@ server {
|
|
| 17 |
proxy_set_header X-Real-IP $remote_addr;
|
| 18 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 19 |
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
|
|
|
|
|
| 20 |
}
|
| 21 |
|
| 22 |
# 3. Route for WebSockets (Pipeline Live Tracer)
|
|
|
|
| 17 |
proxy_set_header X-Real-IP $remote_addr;
|
| 18 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 19 |
proxy_set_header X-Forwarded-Proto $scheme;
|
| 20 |
+
proxy_read_timeout 300;
|
| 21 |
+
proxy_connect_timeout 300;
|
| 22 |
+
proxy_send_timeout 300;
|
| 23 |
}
|
| 24 |
|
| 25 |
# 3. Route for WebSockets (Pipeline Live Tracer)
|