From 7ff34fe623dde6b0a684c45cf33dc54118f9a800 Mon Sep 17 00:00:00 2001 From: 34j <55338215+34j@users.noreply.github.com> Date: Sat, 18 Mar 2023 20:20:33 +0900 Subject: [PATCH] fix(__main__): fix option names --- src/so_vits_svc_fork/__main__.py | 78 ++++++++++++++++---------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/src/so_vits_svc_fork/__main__.py b/src/so_vits_svc_fork/__main__.py index 92e47355..2f571a05 100644 --- a/src/so_vits_svc_fork/__main__.py +++ b/src/so_vits_svc_fork/__main__.py @@ -121,49 +121,49 @@ def train(config_path: Path, model_path: Path): @cli.command() @click.argument( - "input_path", + "input-path", type=click.Path(exists=True), ) @click.option( "-o", - "--output_path", + "--output-path", type=click.Path(), help="path to output dir", ) @click.option("-s", "--speaker", type=str, default=None, help="speaker name") @click.option( "-m", - "--model_path", + "--model-path", type=click.Path(exists=True), default=Path("./logs/44k/"), help="path to model", ) @click.option( "-c", - "--config_path", + "--config-path", type=click.Path(exists=True), default=Path("./configs/44k/config.json"), help="path to config", ) @click.option( "-k", - "--cluster_model_path", + "--cluster-model-path", type=click.Path(exists=True), default=None, help="path to cluster model", ) @click.option("-t", "--transpose", type=int, default=0, help="transpose") @click.option( - "-d", "--db_thresh", type=int, default=-20, help="threshold (DB) (RELATIVE)" + "-db", "--db-thresh", type=int, default=-20, help="threshold (DB) (RELATIVE)" ) @click.option( - "-a", "--auto_predict_f0", type=bool, default=True, help="auto predict f0" + "-a", "--auto-predict-f0", type=bool, default=True, help="auto predict f0" ) @click.option( - "-r", "--cluster_infer_ratio", type=float, default=0, help="cluster infer ratio" + "-r", "--cluster-infer-ratio", type=float, default=0, help="cluster infer ratio" ) -@click.option("-n", "--noise_scale", type=float, default=0.4, help="noise scale") -@click.option("-p", "--pad_seconds", type=float, default=0.5, help="pad seconds") +@click.option("-n", "--noise-scale", type=float, default=0.4, help="noise scale") +@click.option("-p", "--pad-seconds", type=float, default=0.5, help="pad seconds") @click.option( "-d", "--device", @@ -171,9 +171,9 @@ def train(config_path: Path, model_path: Path): default="cuda" if torch.cuda.is_available() else "cpu", help="device", ) -@click.option("-c", "--chunk_seconds", type=float, default=0.5, help="chunk seconds") +@click.option("-ch", "--chunk-seconds", type=float, default=0.5, help="chunk seconds") @click.option( - "-a", "--absolute_thresh", type=bool, default=False, help="absolute thresh" + "-ab", "--absolute-thresh", type=bool, default=False, help="absolute thresh" ) def infer( input_path: Path, @@ -234,21 +234,21 @@ def infer( @cli.command() @click.option( "-m", - "--model_path", + "--model-path", type=click.Path(exists=True), default=Path("./logs/44k/"), help="path to model", ) @click.option( "-c", - "--config_path", + "--config-path", type=click.Path(exists=True), default=Path("./configs/44k/config.json"), help="path to config", ) @click.option( "-k", - "--cluster_model_path", + "--cluster-model-path", type=click.Path(exists=True), default=None, help="path to cluster model", @@ -256,28 +256,28 @@ def infer( @click.option("-t", "--transpose", type=int, default=12, help="transpose") @click.option( "-a", - "--auto_predict_f0", + "--auto-predict-f0", type=bool, default=False, help="auto predict f0 (not recommended for realtime since voice pitch will not be stable)", ) @click.option( - "-r", "--cluster_infer_ratio", type=float, default=0, help="cluster infer ratio" + "-r", "--cluster-infer-ratio", type=float, default=0, help="cluster infer ratio" ) -@click.option("-n", "--noise_scale", type=float, default=0.4, help="noise scale") +@click.option("-n", "--noise-scale", type=float, default=0.4, help="noise scale") @click.option( - "-d", "--db_thresh", type=int, default=-30, help="threshold (DB) (ABSOLUTE)" + "-db", "--db-thresh", type=int, default=-30, help="threshold (DB) (ABSOLUTE)" ) -@click.option("-p", "--pad_seconds", type=float, default=0.02, help="pad seconds") -@click.option("-c", "--chunk_seconds", type=float, default=0.5, help="chunk seconds") +@click.option("-p", "--pad-seconds", type=float, default=0.02, help="pad seconds") +@click.option("-ch", "--chunk-seconds", type=float, default=0.5, help="chunk seconds") @click.option( - "-c", - "--crossfade_seconds", + "-cr", + "--crossfade-seconds", type=float, default=0.01, help="crossfade seconds", ) -@click.option("-b", "--block_seconds", type=float, default=1, help="block seconds") +@click.option("-b", "--block-seconds", type=float, default=1, help="block seconds") @click.option( "-d", "--device", @@ -350,19 +350,19 @@ def vc( @cli.command() @click.option( "-i", - "--input_dir", + "--input-dir", type=click.Path(exists=True), default=Path("./dataset_raw/44k"), help="path to source dir", ) @click.option( "-o", - "--output_dir", + "--output-dir", type=click.Path(), default=Path("./dataset/44k"), help="path to output dir", ) -@click.option("-s", "--sampling_rate", type=int, default=44100, help="sampling rate") +@click.option("-s", "--sampling-rate", type=int, default=44100, help="sampling rate") def pre_resample(input_dir: Path, output_dir: Path, sampling_rate: int) -> None: """Preprocessing part 1: resample""" from .preprocess_resample import preprocess_resample @@ -377,19 +377,21 @@ def pre_resample(input_dir: Path, output_dir: Path, sampling_rate: int) -> None: @cli.command() @click.option( "-i", - "--input_dir", + "--input-dir", type=click.Path(exists=True), default=Path("./dataset/44k"), help="path to source dir", ) @click.option( - "--filelist_path", + "-f", + "--filelist-path", type=click.Path(), default=Path("./filelists/44k"), help="path to filelist dir", ) @click.option( - "--config_path", + "-c", + "--config-path", type=click.Path(), default=Path("./configs/44k/config.json"), help="path to config", @@ -417,14 +419,14 @@ def pre_config( @cli.command() @click.option( "-i", - "--input_dir", + "--input-dir", type=click.Path(exists=True), default=Path("./dataset/44k"), help="path to source dir", ) @click.option( "-c", - "--config_path", + "--config-path", type=click.Path(exists=True), help="path to config", default=Path("./configs/44k/config.json"), @@ -454,9 +456,9 @@ def clean(): @cli.command -@click.option("-i", "--input_path", type=click.Path(exists=True), help="model path") -@click.option("-o", "--output_path", type=click.Path(), help="onnx model path to save") -@click.option("-c", "--config_path", type=click.Path(), help="config path") +@click.option("-i", "--input-path", type=click.Path(exists=True), help="model path") +@click.option("-o", "--output-path", type=click.Path(), help="onnx model path to save") +@click.option("-c", "--config-path", type=click.Path(), help="config path") @click.option("-d", "--device", type=str, default="cpu", help="torch device") def onnx(input_path: Path, output_path: Path, config_path: Path, device: str) -> None: """Export model to onnx""" @@ -477,19 +479,19 @@ def onnx(input_path: Path, output_path: Path, config_path: Path, device: str) -> @cli.command @click.option( "-i", - "--input_dir", + "--input-dir", type=click.Path(exists=True), help="dataset directory", default=Path("./dataset/44k"), ) @click.option( "-o", - "--output_path", + "--output-path", type=click.Path(), help="model path to save", default=Path("./models/44k/kmeans.pt"), ) -@click.option("-n", "--n_clusters", type=int, help="number of clusters", default=10000) +@click.option("-n", "--n-clusters", type=int, help="number of clusters", default=10000) def train_cluster(input_dir: Path, output_path: Path, n_clusters: int) -> None: """Train k-means clustering""" from .cluster.train_cluster import main