Spaces:
Running
on
Zero
Running
on
Zero
Update inference_webui.py
Browse files- inference_webui.py +12 -12
inference_webui.py
CHANGED
@@ -84,12 +84,12 @@ from module.mel_processing import spectrogram_torch
|
|
84 |
from module.models import SynthesizerTrn
|
85 |
from text import cleaned_text_to_sequence
|
86 |
from text.cleaner import clean_text
|
87 |
-
|
88 |
from tools.my_utils import load_audio
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
|
94 |
# os.environ['PYTORCH_ENABLE_MPS_FALLBACK'] = '1' # 确保直接启动推理UI时也能够设置。
|
95 |
|
@@ -100,13 +100,13 @@ else:
|
|
100 |
device = "cpu"
|
101 |
is_half = False
|
102 |
|
103 |
-
i18n_dict={}
|
104 |
-
json_root="tools/i18n/locale"
|
105 |
-
for name in os.listdir(json_root):
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
i18n=gr.I18n(**i18n_dict)
|
110 |
dict_language_v1 = {
|
111 |
i18n("中文"): "all_zh", # 全部按中文识别
|
112 |
i18n("英文"): "en", # 全部按英文识别#######不变
|
@@ -909,5 +909,5 @@ if __name__ == "__main__":
|
|
909 |
server_name="0.0.0.0",
|
910 |
inbrowser=True,
|
911 |
show_api=False,
|
912 |
-
allowed_paths=["/"]
|
913 |
)
|
|
|
84 |
from module.models import SynthesizerTrn
|
85 |
from text import cleaned_text_to_sequence
|
86 |
from text.cleaner import clean_text
|
87 |
+
from tools.i18n.i18n import I18nAuto, scan_language_list
|
88 |
from tools.my_utils import load_audio
|
89 |
|
90 |
+
language=os.environ.get("language","Auto")
|
91 |
+
language=sys.argv[-1] if sys.argv[-1] in scan_language_list() else language
|
92 |
+
i18n = I18nAuto(language="Auto")
|
93 |
|
94 |
# os.environ['PYTORCH_ENABLE_MPS_FALLBACK'] = '1' # 确保直接启动推理UI时也能够设置。
|
95 |
|
|
|
100 |
device = "cpu"
|
101 |
is_half = False
|
102 |
|
103 |
+
# i18n_dict={}
|
104 |
+
# json_root="tools/i18n/locale"
|
105 |
+
# for name in os.listdir(json_root):
|
106 |
+
# with open("%s/%s"%(json_root,name),"r")as f:
|
107 |
+
# data=json.loads(f.read())
|
108 |
+
# i18n_dict[name.split(".json")[0].replace("_","-")]=data
|
109 |
+
# i18n=gr.I18n(**i18n_dict)
|
110 |
dict_language_v1 = {
|
111 |
i18n("中文"): "all_zh", # 全部按中文识别
|
112 |
i18n("英文"): "en", # 全部按英文识别#######不变
|
|
|
909 |
server_name="0.0.0.0",
|
910 |
inbrowser=True,
|
911 |
show_api=False,
|
912 |
+
allowed_paths=["/"]#,i18n=i18n
|
913 |
)
|