trust_remote_code
A safety parameter in the Hugging Face Transformers library that permits loading custom modeling code from a model repository, used to support models with non-standard architectures.
Timeline (last 90 days)
When loading the ZY-S1 model, trust_remote_code=True must be set, and token_type_ids must be passed in — 1 for prompt tokens and 0 for generated tokens.
trust_remote_code=True is a security mechanism in the Hugging Face Transformers library: by default from_pretrained only loads the library's built-in standard model classes; when the model author provides custom modeling code, the user must explicitly pass this parameter to download and execute the .py files in the repository.
Combining remote package resolution ambiguity with unsafe loading and trust_remote_code allows code from the selected repository to be executed.
The trust_remote_code mechanism allows custom Python code from remote repositories to be executed when loading processors or tokenizers, which carries a security risk of being exploited by malicious models to execute arbitrary code.
All Facts (4)
When loading the ZY-S1 model, trust_remote_code=True must be set, and token_type_ids must be passed in — 1 for prompt tokens and 0 for generated tokens.
50%Unverifiedtrust_remote_code=True is a security mechanism in the Hugging Face Transformers library: by default from_pretrained only loads the library's built-in standard model classes; when the model author provides custom modeling code, the user must explicitly pass this parameter to download and execute the .py files in the repository.
50%UnverifiedCombining remote package resolution ambiguity with unsafe loading and trust_remote_code allows code from the selected repository to be executed.
50%UnverifiedThe trust_remote_code mechanism allows custom Python code from remote repositories to be executed when loading processors or tokenizers, which carries a security risk of being exploited by malicious models to execute arbitrary code.
50%