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:
parent
236ad37091
commit
da698cbdae
1 changed files with 6 additions and 0 deletions
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue