# How to use the encoder only from T5?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-use-the-encoder-only-from-t5%2F16644%3E%5C
**Category:** Beginners\
**Created:** [April 9, 2022, 1:39pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-use-the-encoder-only-from-t5%2F16644 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FMina146)%5C
**Post date:** [April 9, 2022, 1:39pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-use-the-encoder-only-from-t5%2F16644%2F1 "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
