AI Security · Supply chain and poisoning
Remote-code loading
For a custom Transformers model, trust_remote_code=True lets the loader import Python from a Hub code repository, possibly separate from the weights repository. That code runs in the loader's process. Tensor-only weights do not disable this code path. Prefer a supported built-in or reviewed local implementation. Otherwise review and pin the model revision and, when code is separate, its code_revision. Isolate loading.