From a232cd8b12ed29444a50b7b3fa1c7e3a7f965860 Mon Sep 17 00:00:00 2001 From: TianYuan Date: Wed, 29 Dec 2021 17:35:46 +0800 Subject: [PATCH] Update fastspeech2.py --- paddlespeech/t2s/models/fastspeech2/fastspeech2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddlespeech/t2s/models/fastspeech2/fastspeech2.py b/paddlespeech/t2s/models/fastspeech2/fastspeech2.py index a5fb7fab..295a2e4b 100644 --- a/paddlespeech/t2s/models/fastspeech2/fastspeech2.py +++ b/paddlespeech/t2s/models/fastspeech2/fastspeech2.py @@ -940,7 +940,8 @@ class StyleFastSpeech2Inference(FastSpeech2Inference): Tensor Output sequence of features (L, odim). """ - spk_id = paddle.to_tensor(spk_id) + if spk_id: + spk_id = paddle.to_tensor(spk_id) normalized_mel, d_outs, p_outs, e_outs = self.acoustic_model.inference( text, durations=None, -- GitLab