# ONNX T5 - Decoding seq2seq tokens

**URL:** <https://discuss.huggingface.co/t/onnx-t5-decoding-seq2seq-tokens/36321>\
**Category:** 🤗Tokenizers\
**Created:** [April 12, 2023, 9:03am UTC](https://discuss.huggingface.co/t/onnx-t5-decoding-seq2seq-tokens/36321 "2023-04-12T09:03:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eusip](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/eusip/32/2714_2.png) [@eusip](https://discuss.huggingface.co/u/eusip)\
**Post date:** [April 12, 2023, 9:03am UTC](https://discuss.huggingface.co/t/onnx-t5-decoding-seq2seq-tokens/36321/1 "2023-04-12T09:03:55Z")

</div>

I am trying to debug an issue decoding text I generate using a finetuned T5 model that I have created yet I continue to encounter the TypeError shown below.

```auto
Traceback (most recent call last):
  File "generate-mirage-onnx.py", line 258, in <module>
    output_text, output_logits = flan_t5(prompt, max_length=512, temperature=0.)
  File "/opt/conda/envs/accelerate/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "generate-mirage-onnx.py", line 112, in forward
    return self.tokenizer.decode(new_tokens), new_logits
  File "/opt/conda/envs/accelerate/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 3480, in decode
    **kwargs,
  File "/opt/conda/envs/accelerate/lib/python3.7/site-packages/transformers/tokenization_utils_fast.py", line 549, in _decode
    text = self._tokenizer.decode(token_ids, skip_special_tokens=skip_special_tokens)
TypeError: argument 'ids': 'float' object cannot be interpreted as an integer

```

I am quite familiar with the tokenizer functionality of Transformers but it appear that there is something about seq2seq models that I am missing. Any tips would be greatly appreciate!

My full script can be found [here](https://gist.github.com/eusip/007c0bcd2f4ca0fe18e88c970b4d9bb0).

@nielsr any tips or suggestions would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Hope2000](https://avatars.discourse-cdn.com/v4/letter/h/ac8455/32.png) [@Hope2000](https://discuss.huggingface.co/u/Hope2000)\
**Post date:** [May 8, 2024, 1:36pm UTC](https://discuss.huggingface.co/t/onnx-t5-decoding-seq2seq-tokens/36321/2 "2024-05-08T13:36:08Z")

</div>

I have the same issue with T5, if you fixed your issue, please let me know how did you do it.
