You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add trust_remote_code=True to load some specific models from huggingface #2207
There are some models that require trust_remote_code=True. This prevents repetitive prompting to press Y/N on the terminal to load the models every time it is being loaded. A typical use case is when encoding queries and searching from a precomputed index of documents/passages using AutoQueryEncoder.
Example of model requiring this argument can be found below and here is link:
tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')
model = AutoModel.from_pretrained('nomic-ai/nomic-embed-text-v1', trust_remote_code=True)
I need this as I am currently running some evals for these models on a cloud gpu using pyserini.
Please let me know if I can quickly whip up a PR to at least add it in for AutoQueryEncoder and perhaps other places where AutoModel.from_pretained(model) is being used currently.
changed the title [-]Add `trust_remote_code=True` to load models from huggingface[/-][+]Add `trust_remote_code=True` to load some specific models from huggingface[/+]on Jul 21, 2025
Activity
[-]Add `trust_remote_code=True` to load models from huggingface[/-][+]Add `trust_remote_code=True` to load some specific models from huggingface[/+]feat: thread trust_remote_code through FaissSearcher