# How to load pretrained models in Wav2Vec2PreTrainedModel

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-pretrained-models-in-wav2vec2pretrainedmodel%2F59387%3E%5C
**Category:** Models\
**Created:** [October 21, 2023, 2:15pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-pretrained-models-in-wav2vec2pretrainedmodel%2F59387 "2023-10-21T14:15:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyuanh](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gyuanh](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fgyuanh)%5C
**Post date:** [October 21, 2023, 2:15pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-pretrained-models-in-wav2vec2pretrainedmodel%2F59387%2F1 "2023-10-21T14:15:43Z")

</div>

In method Wav2Vec2PreTrainedModel we can load the parameters by using  
self.wav2vec2 = Wav2Vec2Model(config)  
in class Wav2Vec2ForCTC,  
if I want to load another pretrained model such as hubert,  
I failed to use  
HubertModel.from\_pretrained(‘facebook/wav2vec2-xls-r-300m’)  
It seems that the parameter did not loaded because the wer remains 1.
