Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hackathon 7th] tts3 with CSMSC #3921

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions paddlespeech/t2s/exps/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import os
from pathlib import Path

import paddle
Expand Down Expand Up @@ -126,6 +127,9 @@ def main():

paddle.set_device(args.device)

# set model_suffix
model_suffix = ".json" if os.path.exists(args.am + ".json") else ".pdmodel"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment with #3923


# frontend
frontend = get_frontend(
lang=args.lang,
Expand All @@ -135,7 +139,7 @@ def main():
# am_predictor
am_predictor = get_predictor(
model_dir=args.inference_dir,
model_file=args.am + ".pdmodel",
model_file=args.am + model_suffix,
params_file=args.am + ".pdiparams",
device=args.device,
use_trt=args.use_trt,
Expand All @@ -148,7 +152,7 @@ def main():
# voc_predictor
voc_predictor = get_predictor(
model_dir=args.inference_dir,
model_file=args.voc + ".pdmodel",
model_file=args.voc + model_suffix,
params_file=args.voc + ".pdiparams",
device=args.device,
use_trt=args.use_trt,
Expand Down
6 changes: 5 additions & 1 deletion paddlespeech/t2s/exps/jets/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import os
from pathlib import Path

import paddle
Expand Down Expand Up @@ -96,13 +97,16 @@ def main():

paddle.set_device(args.device)

# set model_suffix
model_suffix = ".json" if os.path.exists(args.am + ".json") else ".pdmodel"

# frontend
frontend = get_frontend(lang=args.lang, phones_dict=args.phones_dict)

# am_predictor
am_predictor = get_predictor(
model_dir=args.inference_dir,
model_file=args.am + ".pdmodel",
model_file=args.am + model_suffix,
params_file=args.am + ".pdiparams",
device=args.device,
use_trt=args.use_trt,
Expand Down
6 changes: 5 additions & 1 deletion paddlespeech/t2s/exps/vits/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import os
from pathlib import Path

import paddle
Expand Down Expand Up @@ -96,13 +97,16 @@ def main():

paddle.set_device(args.device)

# set model_suffix
model_suffix = ".json" if os.path.exists(args.am + ".json") else ".pdmodel"

# frontend
frontend = get_frontend(lang=args.lang, phones_dict=args.phones_dict)

# am_predictor
am_predictor = get_predictor(
model_dir=args.inference_dir,
model_file=args.am + ".pdmodel",
model_file=args.am + model_suffix,
params_file=args.am + ".pdiparams",
device=args.device,
use_trt=args.use_trt,
Expand Down