Ahmadzei's picture
added 3 more tables for large emb model
5fa1a76
raw
history blame contribute delete
628 Bytes
For example, load a model for sequence classification with [AutoModelForSequenceClassification.from_pretrained]:
from transformers import AutoModelForSequenceClassification
model = AutoModelForSequenceClassification.from_pretrained("distilbert/distilbert-base-uncased")
Easily reuse the same checkpoint to load an architecture for a different task:
from transformers import AutoModelForTokenClassification
model = AutoModelForTokenClassification.from_pretrained("distilbert/distilbert-base-uncased")
For PyTorch models, the from_pretrained() method uses torch.load() which internally uses pickle and is known to be insecure.