(checkpoint_path, bf16, torch_compile, cpu_offload, overlapped_decode, device_id, output_path)
| 49 | @click.option("--device_id", type=int, default=0, help="Device ID to use") |
| 50 | @click.option("--output_path", type=str, default=None, help="Path to save the output") |
| 51 | def main(checkpoint_path, bf16, torch_compile, cpu_offload, overlapped_decode, device_id, output_path): |
| 52 | os.environ["CUDA_VISIBLE_DEVICES"] = str(device_id) |
| 53 | |
| 54 | model_demo = ACEStepPipeline( |
| 55 | checkpoint_dir=checkpoint_path, |
| 56 | dtype="bfloat16" if bf16 else "float32", |
| 57 | torch_compile=torch_compile, |
| 58 | cpu_offload=cpu_offload, |
| 59 | overlapped_decode=overlapped_decode |
| 60 | ) |
| 61 | print(model_demo) |
| 62 | |
| 63 | data_sampler = DataSampler() |
| 64 | |
| 65 | json_data = data_sampler.sample() |
| 66 | json_data = sample_data(json_data) |
| 67 | print(json_data) |
| 68 | |
| 69 | ( |
| 70 | audio_duration, |
| 71 | prompt, |
| 72 | lyrics, |
| 73 | infer_step, |
| 74 | guidance_scale, |
| 75 | scheduler_type, |
| 76 | cfg_type, |
| 77 | omega_scale, |
| 78 | manual_seeds, |
| 79 | guidance_interval, |
| 80 | guidance_interval_decay, |
| 81 | min_guidance_scale, |
| 82 | use_erg_tag, |
| 83 | use_erg_lyric, |
| 84 | use_erg_diffusion, |
| 85 | oss_steps, |
| 86 | guidance_scale_text, |
| 87 | guidance_scale_lyric, |
| 88 | ) = json_data |
| 89 | |
| 90 | model_demo( |
| 91 | audio_duration=audio_duration, |
| 92 | prompt=prompt, |
| 93 | lyrics=lyrics, |
| 94 | infer_step=infer_step, |
| 95 | guidance_scale=guidance_scale, |
| 96 | scheduler_type=scheduler_type, |
| 97 | cfg_type=cfg_type, |
| 98 | omega_scale=omega_scale, |
| 99 | manual_seeds=manual_seeds, |
| 100 | guidance_interval=guidance_interval, |
| 101 | guidance_interval_decay=guidance_interval_decay, |
| 102 | min_guidance_scale=min_guidance_scale, |
| 103 | use_erg_tag=use_erg_tag, |
| 104 | use_erg_lyric=use_erg_lyric, |
| 105 | use_erg_diffusion=use_erg_diffusion, |
| 106 | oss_steps=oss_steps, |
| 107 | guidance_scale_text=guidance_scale_text, |
| 108 | guidance_scale_lyric=guidance_scale_lyric, |
no test coverage detected