Merge pull request #520 from haydonryan/main

Add output filename parameter to infer_cli.
This commit is contained in:
Yushen CHEN
2024-11-24 12:09:28 +08:00
committed by GitHub
2 changed files with 11 additions and 3 deletions

View File

@@ -7,4 +7,5 @@ gen_text = "I don't really care what you call me. I've been a silent spectator,
# File with text to generate. Ignores the text above.
gen_file = ""
remove_silence = false
output_dir = "tests"
output_dir = "tests"
output_file = "infer_cli_out.wav"

View File

@@ -57,7 +57,7 @@ parser.add_argument(
"-f",
"--gen_file",
type=str,
help="File with text to generate. Ignores --text",
help="File with text to generate. Ignores --gen_text",
)
parser.add_argument(
"-o",
@@ -65,6 +65,12 @@ parser.add_argument(
type=str,
help="Path to output folder..",
)
parser.add_argument(
"-w",
"--output_file",
type=str,
help="Filename of output file..",
)
parser.add_argument(
"--remove_silence",
help="Remove silence.",
@@ -104,13 +110,14 @@ if "voices" in config:
if gen_file:
gen_text = codecs.open(gen_file, "r", "utf-8").read()
output_dir = args.output_dir if args.output_dir else config["output_dir"]
output_file = args.output_file if args.output_file else config["output_file"]
model = args.model if args.model else config["model"]
ckpt_file = args.ckpt_file if args.ckpt_file else ""
vocab_file = args.vocab_file if args.vocab_file else ""
remove_silence = args.remove_silence if args.remove_silence else config["remove_silence"]
speed = args.speed
wave_path = Path(output_dir) / "infer_cli_out.wav"
wave_path = Path(output_dir) / output_file
# spectrogram_path = Path(output_dir) / "infer_cli_out.png"
vocoder_name = args.vocoder_name