Model with Genrate method to torchscript

I’ve been trying to export the MusicGen model to TorchScript with the problem. This model uses generate() method, which could not be converted directly to TorchScript to get results,. I searched for many websites but hadn’t found any solutions to solve this. Does anyone have solutions to cope with? I only have a mind that I have to separate all structures and convert them separately.
I am trying to do this because I will continue to deploy this model to iOS and Andriod.
Maybe I have to found a better model :frowning:

1 Like

There are also means such as the ONNX and GGUF formats.

New updates! Although, I have not found a way to convert Generate, I found a way to self-implement the Generate Function, which means it could be implemented in other forms

1 Like