Generate text with torchscripted version of GPT2

Hello! I’m trying to export and perform inference over a GPT2 model from HuggingFaceBefore the conversion to torchscript, the text generation is performed by running model.generate() method from the HuggingFace model to create the response from GPT2 (Generation)

However, after the conversion, the following message appear when running model.generate():

‘RecursiveScriptModule’ object has no attribute ‘generate’

Is there a way of generating text from scripted models?

Thanks in advance