Error while loading the checkpoints
I finetuned the Xlm/roberta and got its .ckpt file. But I am unable to load these check points for testing. While loading, I am getting errors like this:‘XLMRobertaModel’ object has no attribute ‘load_from_checkpoint.’I am using this code to load the checkpoint.from transformers import AutoTokenizermodel_checkpoint = ‘deepset/xlm-roberta-base-squad2’tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)from transformers import AutoModelForQuestionAnsweringmodel = AutoModelForQuestionAnswering.from_pretrained(model_checkpoint)chk_pth="/content/drive/MyDrive/Russian-QA/epoch=18-step=53826.ckpt"model2=model.load_from_checkpoint(chk_pth)kindly help me to sort out the slolution
2021-10-11T14:17:05Z
I’m not sure where you have seen theload_from_checkpointmethod but it does not exist in Transformers. Same for the.ckptfile, it’s not something generated from our side.