import yaml import torch from ldm.utils.util import instantiate_from_config configs = yaml.load(open('/path/to/model/iflytek/AudioFly/config/config.yaml', "r"), Loader=yaml.FullLoader) model = instantiate_from_config(configs["model"]) checkpoint = torch.load('/path/to/model/iflytek/AudioFly/models/ldm/model.ckpt') model.load_state_dict(checkpoint, strict=False) model.eval() model = model.cuda() text = 'Fierce winds howl through the valley' name = 'result' savedir = './result' model.generate_sample( textlist=[text], name=name, cfg=3.5,# Guidance scale (controls how strongly generation follows the text prompt); not recommended to change ddim_steps=200, # Number of denoising steps in the diffusion process; not recommended to change outputdir=f"{savedir}")