bugfix remove module

This commit is contained in:
wataru 2023-04-11 07:37:39 +09:00
parent b57ddc180c
commit f02489a86f
5 changed files with 9 additions and 7 deletions

View File

@ -8,7 +8,8 @@ if sys.platform.startswith('darwin'):
modulePath = os.path.join(baseDir[0], "MMVC_Client_v13", "python")
sys.path.append(modulePath)
else:
sys.path.append("MMVC_Client_v13/python")
modulePath = os.path.join("MMVC_Client_v13", "python")
sys.path.append(modulePath)
from dataclasses import dataclass, asdict
@ -210,7 +211,7 @@ class MMVCv13:
val = sys.modules.get(key)
try:
file_path = val.__file__
if file_path.find("MMVC_Client_v13/python") >= 0:
if file_path.find(remove_path + os.path.sep) >= 0:
print("remove", key, file_path)
sys.modules.pop(key)
except Exception as e:

View File

@ -8,7 +8,8 @@ if sys.platform.startswith('darwin'):
modulePath = os.path.join(baseDir[0], "MMVC_Client_v15", "python")
sys.path.append(modulePath)
else:
sys.path.append("MMVC_Client_v15/python")
modulePath = os.path.join("MMVC_Client_v15", "python")
sys.path.append(modulePath)
from dataclasses import dataclass, asdict
import numpy as np
@ -257,7 +258,7 @@ class MMVCv15:
val = sys.modules.get(key)
try:
file_path = val.__file__
if file_path.find("MMVC_Client_v15/python") >= 0:
if file_path.find(remove_path + os.path.sep) >= 0:
print("remove", key, file_path)
sys.modules.pop(key)
except Exception as e:

View File

@ -288,7 +288,7 @@ class RVC:
val = sys.modules.get(key)
try:
file_path = val.__file__
if file_path.find("RVC/") >= 0:
if file_path.find("RVC" + os.path.sep) >= 0:
print("remove", key, file_path)
sys.modules.pop(key)
except Exception as e:

View File

@ -361,7 +361,7 @@ class SoVitsSvc40:
val = sys.modules.get(key)
try:
file_path = val.__file__
if file_path.find("so-vits-svc-40/") >= 0:
if file_path.find("so-vits-svc-40" + os.path.sep) >= 0:
print("remove", key, file_path)
sys.modules.pop(key)
except Exception as e:

View File

@ -325,7 +325,7 @@ class SoVitsSvc40v2:
val = sys.modules.get(key)
try:
file_path = val.__file__
if file_path.find("so-vits-svc-40v2/") >= 0:
if file_path.find("so-vits-svc-40v2" + os.path.sep) >= 0:
print("remove", key, file_path)
sys.modules.pop(key)
except Exception as e: