File size: 437 Bytes
5fa1a76 |
1 2 3 4 5 6 7 8 |
Set trust_remote_code=True to use a model with custom code: from transformers import AutoModelForImageClassification model = AutoModelForImageClassification.from_pretrained("sgugger/custom-resnet50d", trust_remote_code=True) It is also strongly encouraged to pass a commit hash as a revision to make sure the author of the models did not update the code with some malicious new lines (unless you fully trust the authors of the models). |