fix issue with obtaining the decoder layer number when converting the T5 model. (#17185)
### Description
fix issue with obtaining the decoder layer number when converting the T5
model.
### Motivation and Context
fix issue: https://github.com/microsoft/onnxruntime/issues/17072
Test with
[byt5-small](https://huggingface.co/google/byt5-small/tree/main) model,
which has 12 encoder layers and 4 decoder layers.
Here is the log.
