Skip to content

Commit

Permalink
fix(__main__): fix option names
Browse files Browse the repository at this point in the history
  • Loading branch information
34j committed Mar 18, 2023
1 parent b988101 commit 7ff34fe
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions src/so_vits_svc_fork/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,59 +121,59 @@ 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",
type=str,
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,
Expand Down Expand Up @@ -234,50 +234,50 @@ 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",
)
@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",
Expand Down Expand Up @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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"""
Expand All @@ -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
Expand Down

0 comments on commit 7ff34fe

Please sign in to comment.