diff --git a/server/const.py b/server/const.py index 6c53f5f8..48a25458 100644 --- a/server/const.py +++ b/server/const.py @@ -14,6 +14,9 @@ NATIVE_CLIENT_FILE_WIN = os.path.join(sys._MEIPASS, "voice-changer-native-client NATIVE_CLIENT_FILE_MAC = os.path.join(sys._MEIPASS, "voice-changer-native-client.app", "Contents", "MacOS", "voice-changer-native-client") if hasattr(sys, "_MEIPASS") else "voice-changer-native-client" +HUBERT_ONNX_MODEL_PATH = os.path.join(sys._MEIPASS, "model_hubert/hubert_simple.onnx") if hasattr(sys, + "_MEIPASS") else "model_hubert/hubert_simple.onnx" + TMP_DIR = os.path.join(tmpdir.name, "tmp_dir") if hasattr(sys, "_MEIPASS") else "tmp_dir" os.makedirs(TMP_DIR, exist_ok=True) diff --git a/server/voice_changer/SoVitsSvc40/SoVitsSvc40.py b/server/voice_changer/SoVitsSvc40/SoVitsSvc40.py index 70fc54ae..873fbd9e 100644 --- a/server/voice_changer/SoVitsSvc40/SoVitsSvc40.py +++ b/server/voice_changer/SoVitsSvc40/SoVitsSvc40.py @@ -17,7 +17,7 @@ import numpy as np import torch import onnxruntime # onnxruntime.set_default_logger_severity(3) - +from const import HUBERT_ONNX_MODEL_PATH import pyworld as pw @@ -85,7 +85,7 @@ class SoVitsSvc40: ort_options = onnxruntime.SessionOptions() ort_options.intra_op_num_threads = 8 self.hubert_onnx = onnxruntime.InferenceSession( - "model_hubert/hubert_simple.onnx", + HUBERT_ONNX_MODEL_PATH, providers=providers ) else: