unsloth/studio/backend/core/rag
Roland Tannous 1db654abb1 Studio: print reranker stage milestones to stderr for diagnostic visibility
When the reranker hung on rerank=True there were zero log lines after
'retrieved=N (no threshold)', which made it impossible to tell whether
the hang was in _load (CrossEncoder construction), in get_reranker's
lock acquisition, or in predict. Structlog routing may also be the
culprit since we never saw the 'Loading RAG reranker' info line.

Add unconditional stderr prints at each milestone — entered, device
resolved, before CrossEncoder, after CrossEncoder, rerank entered,
predict starting, predict done. These bypass any logger config and
show up directly in /tmp/studio.log next to the rest of the captured
stdout/stderr. Leaving structlog logger.info calls in place too so
the structured stream still gets the same data when routing works.
2026-05-27 21:05:22 +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: print reranker stage milestones to stderr for diagnostic visibility 2026-05-27 21:05:22 +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