Tf to pytorch
Hi, I have XLNet checkpoint file and want to convert it to pytorch. I have converted the file to pytorch and when I am using the same file with simpletramsformers for text classification. It says the number of labels is not matching. Where should I specify the number of classes while converting from tf to pytorch?
#Code used to convert from tf to Pytorch

import torch

from transformers import (
    CONFIG_NAME,
    WEIGHTS_NAME,
    XLNetConfig,
    XLNetForQuestionAnswering,
    XLNetForSequenceClassification,
    XLNetLMHeadModel,
    load_tf_weights_in_xlnet,
    XLNetModel
)


tf_checkpoint_path="./model/"
xlnet_config_file = "./model/config.json"
pytorch_dump_path="./xlnetpytorch/"

config = XLNetConfig.from_json_file(xlnet_config_file)
print("Building PyTorch model from configuration: {}".format(str(config)))
model = XLNetForSequenceClassification(config)

#Load weights from tf checkpoint
model =   load_tf_weights_in_xlnet(model, config, tf_checkpoint_path)

#Save pytorch-model
print("Save PyTorch model to {}".format(pytorch_dump_path))
model.save_pretrained(pytorch_dump_path)<|||||>Use config.num_labels = 536 (number of labels) in my case  to define the number of labels in custom data set before initialising model i.e., before line model = XLNetForSequenceClassification(config)