Spaces:
Sleeping
Sleeping
mrfakename
commited on
Commit
•
80a2615
1
Parent(s):
1a098dc
Sync from GitHub repo
Browse filesThis Space is synced from the GitHub repo: https://github.com/SWivid/F5-TTS. Please submit contributions to the Space there
- inference-cli.py +10 -0
- inference-cli.toml +2 -0
inference-cli.py
CHANGED
@@ -20,6 +20,7 @@ import tomli
|
|
20 |
import argparse
|
21 |
import tqdm
|
22 |
from pathlib import Path
|
|
|
23 |
|
24 |
parser = argparse.ArgumentParser(
|
25 |
prog="python3 inference-cli.py",
|
@@ -56,6 +57,12 @@ parser.add_argument(
|
|
56 |
type=str,
|
57 |
help="Text to generate.",
|
58 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
parser.add_argument(
|
60 |
"-o",
|
61 |
"--output_dir",
|
@@ -73,6 +80,9 @@ config = tomli.load(open(args.config, "rb"))
|
|
73 |
ref_audio = args.ref_audio if args.ref_audio else config["ref_audio"]
|
74 |
ref_text = args.ref_text if args.ref_text != "666" else config["ref_text"]
|
75 |
gen_text = args.gen_text if args.gen_text else config["gen_text"]
|
|
|
|
|
|
|
76 |
output_dir = args.output_dir if args.output_dir else config["output_dir"]
|
77 |
model = args.model if args.model else config["model"]
|
78 |
remove_silence = args.remove_silence if args.remove_silence else config["remove_silence"]
|
|
|
20 |
import argparse
|
21 |
import tqdm
|
22 |
from pathlib import Path
|
23 |
+
import codecs
|
24 |
|
25 |
parser = argparse.ArgumentParser(
|
26 |
prog="python3 inference-cli.py",
|
|
|
57 |
type=str,
|
58 |
help="Text to generate.",
|
59 |
)
|
60 |
+
parser.add_argument(
|
61 |
+
"-f",
|
62 |
+
"--gen_file",
|
63 |
+
type=str,
|
64 |
+
help="File with text to generate. Ignores --text",
|
65 |
+
)
|
66 |
parser.add_argument(
|
67 |
"-o",
|
68 |
"--output_dir",
|
|
|
80 |
ref_audio = args.ref_audio if args.ref_audio else config["ref_audio"]
|
81 |
ref_text = args.ref_text if args.ref_text != "666" else config["ref_text"]
|
82 |
gen_text = args.gen_text if args.gen_text else config["gen_text"]
|
83 |
+
gen_file = args.gen_file if args.gen_file else config["gen_file"]
|
84 |
+
if gen_file:
|
85 |
+
gen_text = codecs.open(gen_file, "r", "utf-8").read()
|
86 |
output_dir = args.output_dir if args.output_dir else config["output_dir"]
|
87 |
model = args.model if args.model else config["model"]
|
88 |
remove_silence = args.remove_silence if args.remove_silence else config["remove_silence"]
|
inference-cli.toml
CHANGED
@@ -4,5 +4,7 @@ ref_audio = "tests/ref_audio/test_en_1_ref_short.wav"
|
|
4 |
# If an empty "", transcribes the reference audio automatically.
|
5 |
ref_text = "Some call me nature, others call me mother nature."
|
6 |
gen_text = "I don't really care what you call me. I've been a silent spectator, watching species evolve, empires rise and fall. But always remember, I am mighty and enduring. Respect me and I'll nurture you; ignore me and you shall face the consequences."
|
|
|
|
|
7 |
remove_silence = true
|
8 |
output_dir = "tests"
|
|
|
4 |
# If an empty "", transcribes the reference audio automatically.
|
5 |
ref_text = "Some call me nature, others call me mother nature."
|
6 |
gen_text = "I don't really care what you call me. I've been a silent spectator, watching species evolve, empires rise and fall. But always remember, I am mighty and enduring. Respect me and I'll nurture you; ignore me and you shall face the consequences."
|
7 |
+
# File with text to generate. Ignores the text above.
|
8 |
+
gen_file = ""
|
9 |
remove_silence = true
|
10 |
output_dir = "tests"
|