From f264b912fc2134cf7d06743f8aa28d28ae00103c Mon Sep 17 00:00:00 2001 From: TianYuan Date: Thu, 7 Apr 2022 11:53:45 +0000 Subject: [PATCH] add warmup for frontend, test=doc --- paddlespeech/t2s/exps/ort_predict_e2e.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/paddlespeech/t2s/exps/ort_predict_e2e.py b/paddlespeech/t2s/exps/ort_predict_e2e.py index a5f5c7c4..5b5d9768 100644 --- a/paddlespeech/t2s/exps/ort_predict_e2e.py +++ b/paddlespeech/t2s/exps/ort_predict_e2e.py @@ -79,6 +79,13 @@ def ort_predict(args): voc_sess.run(None, {"logmel": data}) print("warm up done!") + # frontend warmup + # Loading model cost 0.5+ seconds + if args.lang == 'zh': + frontend.get_input_ids("你好,欢迎使用飞桨框架进行深度学习研究!", merge_sentences=True) + else: + print("lang should in be 'zh' here!") + N = 0 T = 0 merge_sentences = True @@ -132,9 +139,7 @@ def parse_args(): '--voc', type=str, default='hifigan_csmsc', - choices=[ - 'hifigan_csmsc', 'mb_melgan_csmsc' - ], + choices=['hifigan_csmsc', 'mb_melgan_csmsc'], help='Choose vocoder type of tts task.') # other parser.add_argument(