I am training a binary classification model based on this model checkpoint: dccuchile/bert-base-spanish-wwm-cased
When deployment, it uses by default these labels: LABEL_0, LABEL_1.
My goal is to deploy it with my own labels. Browsing the forum I came across this thread, and it seems that resolve a similiar problem.
After read this thread, my code looks like:
label2id = {
"0": "goodUser",
"1": "badUserFraud"
}
id2label = {
"goodUser": 0,
"badUserFraud": 1
}
# download model from model hub
config = AutoConfig.from_pretrained(args.model_name, label2id=label2id, id2label=id2label)
model = AutoModelForSequenceClassification.from_pretrained(args.model_name, config=config)
tokenizer = AutoTokenizer.from_pretrained(args.model_name)
The training step going well, but when deployment step I find this error: