Studio: pass trust_remote_code to RAG embedder loader

BGE-VL (multimodal) and nomic-embed-text-v1.5 (late chunking) both
ship custom modeling code in their model repos; sentence-transformers
refuses to import the referenced module (e.g. bge_vl_clip_transformer)
without trust_remote_code=True. Safe to enable because the embedder
matrix is config-pinned — users don't supply arbitrary names.
This commit is contained in:
Roland Tannous 2026-05-24 21:14:22 +04:00
commit da698cbdae

View file

@ -31,9 +31,15 @@ def _load(model_name: str) -> Any:
from unsloth import FastSentenceTransformer
logger.info("Loading RAG embedder: %s", model_name)
# trust_remote_code is required for the multimodal / late-chunking
# embedders in RAG_EMBEDDER_MATRIX: BGE-VL ships a custom
# `bge_vl_clip_transformer` module and nomic-embed-text-v1.5 ships
# a custom modeling file. Both repos are pinned in our config — we
# control which names land here — so opting in is safe.
return FastSentenceTransformer.from_pretrained(
model_name,
for_inference = True,
trust_remote_code = True,
)