add --tts-rule-fsts argument at offline-tts.py (#413)
Co-authored-by: longshiming <longshiming@greesoft.com>
This commit is contained in:
@@ -21,6 +21,22 @@ python3 ./python-api-examples/offline-tts.py \
|
|||||||
--output-filename=./generated.wav \
|
--output-filename=./generated.wav \
|
||||||
'liliana, the most beautiful and lovely assistant of our team!'
|
'liliana, the most beautiful and lovely assistant of our team!'
|
||||||
|
|
||||||
|
2. Download a model
|
||||||
|
|
||||||
|
wget https://huggingface.co/csukuangfj/vits-zh-aishell3/resolve/main/vits-aishell3.onnx
|
||||||
|
wget https://huggingface.co/csukuangfj/vits-zh-aishell3/resolve/main/lexicon.txt
|
||||||
|
wget https://huggingface.co/csukuangfj/vits-zh-aishell3/resolve/main/tokens.txt
|
||||||
|
wget https://huggingface.co/csukuangfj/vits-zh-aishell3/resolve/main/rule.fst
|
||||||
|
|
||||||
|
python3 ./python-api-examples/offline-tts.py
|
||||||
|
--vits-model=./vits-aishell3.onnx \
|
||||||
|
--vits-lexicon=./lexicon.txt \
|
||||||
|
--vits-tokens=./tokens.txt \
|
||||||
|
--tts-rule-fsts=./rule.fst \
|
||||||
|
--sid=21 \
|
||||||
|
--output-filename=./liubei-21.wav \
|
||||||
|
"勿以恶小而为之,勿以善小而不为。惟贤惟德,能服于人。122334"
|
||||||
|
|
||||||
Please see
|
Please see
|
||||||
https://k2-fsa.github.io/sherpa/onnx/tts/index.html
|
https://k2-fsa.github.io/sherpa/onnx/tts/index.html
|
||||||
for details.
|
for details.
|
||||||
@@ -56,6 +72,13 @@ def get_args():
|
|||||||
help="Path to tokens.txt",
|
help="Path to tokens.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--tts-rule-fsts",
|
||||||
|
type=str,
|
||||||
|
default="",
|
||||||
|
help="Path to rule.fst",
|
||||||
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--output-filename",
|
"--output-filename",
|
||||||
type=str,
|
type=str,
|
||||||
@@ -124,7 +147,8 @@ def main():
|
|||||||
provider=args.provider,
|
provider=args.provider,
|
||||||
debug=args.debug,
|
debug=args.debug,
|
||||||
num_threads=args.num_threads,
|
num_threads=args.num_threads,
|
||||||
)
|
),
|
||||||
|
rule_fsts=args.tts_rule_fsts
|
||||||
)
|
)
|
||||||
tts = sherpa_onnx.OfflineTts(tts_config)
|
tts = sherpa_onnx.OfflineTts(tts_config)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user