audiocraft
audiocraft copied to clipboard
How to convert musicgen model to ONNX for deploy it on mobile devices
i want to running musicgen model on model devices, then i have to convert musicgen model to onnx format, i split musicgen to language model and compression model, i got errors when tried to convert language model to ONNX format, May i know if any suggestion for help convert it to onnx?
The same problem. Did you solved it ?
any update on this? Im trying to run convert a trained model to onnx and run it like this:
`from audiocraft.data.audio import audio_write from audiocraft.models import musicgen import torch
model = musicgen.MusicGen.get_pretrained('medium', device='cuda') model.set_generation_params(duration=8) model.lm.load_state_dict(torch.load('lm_final.pt ONNX MODEL HERE'))`