Hi.
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.

  
    
    
    Change label names on inference API Beginners
  
  
    Hi there, 
I recently uploaded my first model to the model hub and I’m wondering how I can change the label names that are returned by the inference API. Right now, the API returns “LABEL_0”, “LABEL_1”, etc. with the predictions and I would like it to be something like “Economy”, “Welfare”, etc. 
I looked at the files of other hosted models and I saw that others changed the id2label and label2id in the config.json file, so I also did that here, but the inference API still returns “LABEL_0”. Do I…
  


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:

image1632×552 101 KB

Thanks in advance