[doc] custom_models: mention security features of the Hub (#15768)

* custom_models: tiny doc addition

* mention security feature earlier in the section

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
This commit is contained in:
Julien Chaumond
2022-02-23 11:40:06 -05:00
committed by GitHub
parent 9e71d46455
commit 32f5de10a0

View File

@@ -304,8 +304,9 @@ See the [sharing tutorial](model_sharing) for more information on the push to Hu
## Using a model with custom code ## Using a model with custom code
You can use any configuration, model or tokenizer with custom code files in its repository with the auto-classes and You can use any configuration, model or tokenizer with custom code files in its repository with the auto-classes and
the `from_pretrained` method. The only thing is that you have to add an extra argument to make sure you have read the the `from_pretrained` method. All files and code uploaded to the Hub are scanned for malware (refer to the [Hub security](https://huggingface.co/docs/hub/security#malware-scanning) documentation for more information), but you should still
online code and trust the author of that model, to avoid executing malicious code on your machine: review the model code and author to avoid executing malicious code on your machine. Set `trust_remote_code=True` to use
a model with custom code:
```py ```py
from transformers import AutoModelForImageClassification from transformers import AutoModelForImageClassification