# Error while loading the xlm\\roberta checkpoints

**URL:** <https://discuss.huggingface.co/t/error-while-loading-the-xlm-roberta-checkpoints/10646>\
**Category:** Beginners\
**Created:** [October 9, 2021, 3:15pm UTC](https://discuss.huggingface.co/t/error-while-loading-the-xlm-roberta-checkpoints/10646 "2021-10-09T15:15:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MuhammadRehman](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MuhammadRehman](https://discuss.huggingface.co/u/MuhammadRehman)\
**Post date:** [October 9, 2021, 3:15pm UTC](https://discuss.huggingface.co/t/error-while-loading-the-xlm-roberta-checkpoints/10646/1 "2021-10-09T15:15:32Z")

</div>

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 AutoTokenizer  
model\_checkpoint = ‘deepset/xlm-roberta-base-squad2’  
tokenizer = AutoTokenizer.from\_pretrained(model\_checkpoint)

from transformers import AutoModelForQuestionAnswering  
model = 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
