add vram optimization cmdline args
This commit is contained in:
@@ -40,15 +40,23 @@ def sample_data(json_data):
|
||||
@click.option(
|
||||
"--torch_compile", type=bool, default=False, help="Whether to use torch compile"
|
||||
)
|
||||
@click.option(
|
||||
"--cpu_offload", type=bool, default=False, help="Whether to use CPU offloading (only load current stage's model to GPU)"
|
||||
)
|
||||
@click.option(
|
||||
"--overlapped_decode", type=bool, default=False, help="Whether to use overlapped decoding (run dcae and vocoder using sliding windows)"
|
||||
)
|
||||
@click.option("--device_id", type=int, default=0, help="Device ID to use")
|
||||
@click.option("--output_path", type=str, default=None, help="Path to save the output")
|
||||
def main(checkpoint_path, bf16, torch_compile, device_id, output_path):
|
||||
def main(checkpoint_path, bf16, torch_compile, cpu_offload, overlapped_decode, device_id, output_path):
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = str(device_id)
|
||||
|
||||
model_demo = ACEStepPipeline(
|
||||
checkpoint_dir=checkpoint_path,
|
||||
dtype="bfloat16" if bf16 else "float32",
|
||||
torch_compile=torch_compile,
|
||||
cpu_offload=cpu_offload,
|
||||
overlapped_decode=overlapped_decode
|
||||
)
|
||||
print(model_demo)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user