# How to use the encoder only from T5?

**URL:** <https://discuss.huggingface.co/t/how-to-use-the-encoder-only-from-t5/16644>\
**Category:** Beginners\
**Created:** [April 9, 2022, 1:39pm UTC](https://discuss.huggingface.co/t/how-to-use-the-encoder-only-from-t5/16644 "2022-04-09T13:39:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mina146](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mina146/32/4456_2.png) [@Mina146](https://discuss.huggingface.co/u/Mina146)\
**Post date:** [April 9, 2022, 1:39pm UTC](https://discuss.huggingface.co/t/how-to-use-the-encoder-only-from-t5/16644/1 "2022-04-09T13:39:50Z")

</div>

I need to use the encoder part only from T5 and load its pretrained weights, I don’t want the decoder or any part the is connecting them together.  
If this is possible, it would be great, I searched a lot but I couldn’t find a useful guide on this. I found the T5encoderModel on huggingface model docs, but I am not sure if this is what I am looking for or not
