Does generate() support "Export to TorchScript"
### Feature request

Does T5 `model.generate` support "Export to TorchScript"
https://huggingface.co/docs/transformers/main/en/torchscript

I want to make a faster deployment and transform `model.generate` like this:
https://discuss.huggingface.co/t/t5-base-not-torchscriptable/11173

thanks all

cc @gante
<|||||>Hey @gongel 👋 The model foward pass probably can be serialized, but the full `model.generate` cannot. We are working on the serialization of `model.generate` as we speak, in the context of PyTorch dynamo.

Can I be of further assistance? :)<|||||>Thank you, I'm looking forward to it<|||||>Is there an issue tracking this? What's the status of `TorchScript`ing `model.generate`? Or can `generate` be a standalone function and call `TorchScript` module?<|||||>@ZisIsNotZis AFAIK no tracking issue. We are exploring generation speedups (which will likely include static shapes, i.e. should be TorchScript compilable) at the moment, to be released in ~3 months.