unsloth/studio/backend/core/rag
Roland Tannous 29e8cad8b8 Studio: fix RAG reranker deadlock on first load (Lock -> RLock)
get_reranker() acquires the module-level _lock and then, on first load,
calls unload() to clear any stale state before _load() instantiates the
CrossEncoder. unload() acquires the same _lock — but threading.Lock is
non-reentrant, so the second acquisition by the holding thread blocked
forever. Symptom: rerank=True hung the search_knowledge_base tool with
no further log output past 'rerank entered'.

Switch to threading.RLock so the same thread can re-enter without
blocking. unload()'s independent callers still work the same way; the
only behaviour change is that re-entrant acquisition from one thread
now succeeds.
2026-05-27 21:10:38 +04:00
..
parsers Studio: splice VLM figure captions next to their 'Figure N:' line 2026-05-27 17:02:36 +04:00
__init__.py Studio: add RAG with hybrid search, reranker, chat integration 2026-05-23 18:46:15 +04:00
bm25.py Studio: trim verbose comments/docstrings across RAG code 2026-05-26 13:51:11 +04:00
captioner.py Studio: render figure regions (vector + raster) for RAG captioning 2026-05-27 16:36:54 +04:00
chunking.py Studio: break RAG chunks at figure/table caption boundaries 2026-05-27 16:09:23 +04:00
db.py Studio: trim verbose comments/docstrings across RAG code 2026-05-26 13:51:11 +04:00
embeddings.py Studio: pass BytesIO (not PIL Image) to BGE-VL encode so model.data_process can re-open 2026-05-27 05:44:40 +04:00
ingestion.py Studio: route RAG ingestion + captioner loggers through structlog 2026-05-27 15:20:22 +04:00
reranker.py Studio: fix RAG reranker deadlock on first load (Lock -> RLock) 2026-05-27 21:10:38 +04:00
retrieval.py Studio: add figure-reference retrieval source to RAG hybrid search 2026-05-27 16:22:08 +04:00
scope.py Studio: text-mode default with VLM-captioned figure splicing; helper VLM fallback 2026-05-27 11:16:56 +04:00
tool.py Studio: hide RAG retrieval scores from chunks, citations, and side panel 2026-05-27 17:15:18 +04:00
vector_store.py Studio: trim verbose comments/docstrings across RAG code 2026-05-26 13:51:11 +04:00