It works if you change it like this, but I’m not sure if it’s correct…
model = AutoModelForSequenceClassification.from_pretrained(model_name, config=config)
#model = AutoModelForSequenceClassification.from_pretrained(model_name, config=config, ignore_mismatched_sizes=True)