How to use the encoder only from T5?

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