Ahmadzei's picture
added 3 more tables for large emb model
5fa1a76
raw
history blame contribute delete
437 Bytes
Specify the number of labels along with the number of expected labels, and the label mappings:
from transformers import AutoModelForImageClassification, TrainingArguments, Trainer
model = AutoModelForImageClassification.from_pretrained(
checkpoint,
num_labels=len(labels),
id2label=id2label,
label2id=label2id,
)
At this point, only three steps remain:
Define your training hyperparameters in [TrainingArguments].