from audiocraft.audiogen import AudioGen #, audio_write print('\n\n\n\n___________________') txt = 'austrian music' sound_generator = AudioGen.get_pretrained('facebook/audiogen-medium') sound_generator.set_generation_params(duration=4.7) # why is generating so long at 14 seconds x = sound_generator.generate([txt])[0].detach().cpu().numpy()[0, :] x /= np.abs(x).max() + 1e-7 audiofile.write('del_seane.wav', x, 16000)