A city-archives labeling script imports a hard-coded BertForSequenceClassification class, then the Hub checkpoint switches to another encoder family. Which loaders keep the same few lines working?
Select an answer to reveal the explanation.
Short Explanation
A hard-coded BertForSequenceClassification class breaks when the Hub card switches families. AutoTokenizer and AutoModelForSequenceClassification read the checkpoint config and keep the same few lines working. Kernel rewrites, NCCL wrappers, and an image processor are not that loader.
Full Explanation
Auto classes read the checkpoint config and construct the matching tokenizer and model, so the same few lines survive a family change on the Hub. A hard-coded BERT class breaks when the card moves. CUDA-kernel rewrites and NCCL wrappers are not the associate fix. An image processor is the wrong loader for a text classification checkpoint.