diff --git a/server/voice_changer/MMVCv13/MMVCv13.py b/server/voice_changer/MMVCv13/MMVCv13.py index f31eb24d..0a65f9cb 100644 --- a/server/voice_changer/MMVCv13/MMVCv13.py +++ b/server/voice_changer/MMVCv13/MMVCv13.py @@ -1,7 +1,16 @@ import sys -sys.path.append("MMVC_Client_v13/python") -from dataclasses import dataclass, asdict import os +if sys.platform.startswith('darwin'): + baseDir = [x for x in sys.path if x.endswith("Contents/MacOS")] + if len(baseDir) != 1: + print("baseDir should be only one ", baseDir) + sys.exit() + modulePath = os.path.join(baseDir[0], "MMVC_Client_v13", "python") + sys.path.append(modulePath) +else: + sys.path.append("MMVC_Client_v13/python") + +from dataclasses import dataclass, asdict import numpy as np import torch import onnxruntime diff --git a/server/voice_changer/MMVCv15/MMVCv15.py b/server/voice_changer/MMVCv15/MMVCv15.py index 109a3735..dc1d8e4d 100644 --- a/server/voice_changer/MMVCv15/MMVCv15.py +++ b/server/voice_changer/MMVCv15/MMVCv15.py @@ -1,7 +1,16 @@ import sys -sys.path.append("MMVC_Client_v15/python") -from dataclasses import dataclass, asdict import os +if sys.platform.startswith('darwin'): + baseDir = [x for x in sys.path if x.endswith("Contents/MacOS")] + if len(baseDir) != 1: + print("baseDir should be only one ", baseDir) + sys.exit() + modulePath = os.path.join(baseDir[0], "MMVC_Client_v15", "python") + sys.path.append(modulePath) +else: + sys.path.append("MMVC_Client_v15/python") + +from dataclasses import dataclass, asdict import numpy as np import torch import onnxruntime