Let's get rid of load_task_extras, which is a bad and confusing name. Instead, we will adopt some behavior that is specific to classifiers, but a lot simpler.
# Random head.
classifier = ImageClassifier.from_preset("resnet50", num_classes=2)
# Pretrained head.
classifier = ImageClassifier.from_preset("resnet50")
# Error, must provide num_classes.
classifier = TextClassifier.from_preset("bert_base_en")
Let's get rid of
load_task_extras
, which is a bad and confusing name. Instead, we will adopt some behavior that is specific to classifiers, but a lot simpler.