From c4b6c169fc9d2266047d49dc485c51008719d015 Mon Sep 17 00:00:00 2001 From: tsukumi Date: Sat, 28 Sep 2024 17:36:26 +0900 Subject: [PATCH] Fix: Inference failure with some ExecutionProviders length_scale, etc. were passed as one-dimensional arrays when they should have been passed as scalar values. --- style_bert_vits2/models/infer_onnx.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/style_bert_vits2/models/infer_onnx.py b/style_bert_vits2/models/infer_onnx.py index 8f74fc1..508c242 100644 --- a/style_bert_vits2/models/infer_onnx.py +++ b/style_bert_vits2/models/infer_onnx.py @@ -165,10 +165,10 @@ def infer_onnx( lang_ids, ja_bert, style_vec_tensor, - np.array([length_scale], dtype=np.float32), - np.array([sdp_ratio], dtype=np.float32), - np.array([noise_scale], dtype=np.float32), - np.array([noise_scale_w], dtype=np.float32), + np.array(length_scale, dtype=np.float32), + np.array(sdp_ratio, dtype=np.float32), + np.array(noise_scale, dtype=np.float32), + np.array(noise_scale_w, dtype=np.float32), ] else: input_tensor = [ @@ -181,10 +181,10 @@ def infer_onnx( ja_bert, en_bert, style_vec_tensor, - np.array([length_scale], dtype=np.float32), - np.array([sdp_ratio], dtype=np.float32), - np.array([noise_scale], dtype=np.float32), - np.array([noise_scale_w], dtype=np.float32), + np.array(length_scale, dtype=np.float32), + np.array(sdp_ratio, dtype=np.float32), + np.array(noise_scale, dtype=np.float32), + np.array(noise_scale_w, dtype=np.float32), ] # 入力テンソルを転送する GPU デバイスを取得