From ea56b814bdefc8be8534253bce00ce19f4a344aa Mon Sep 17 00:00:00 2001
From: XXXXRT666 <157766680+XXXXRT666@users.noreply.github.com>
Date: Tue, 13 Aug 2024 16:31:12 +0800
Subject: [PATCH] Chores (#1422)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Make Gradio Great Again
附带vs2017下载链接
增加了各种数据集检查,若缺失会弹出warning
修复了warning乱弹的bug
修复了参考音频混合只能上传一条的bug
修复了下载G2PW Model出现import错误的bug
修复了Windows训练无N卡在预处理阶段的报错
---
GPT_SoVITS/download.py | 2 +-
GPT_SoVITS/inference_webui.py | 13 +-
GPT_SoVITS/prepare_datasets/1-get-text.py | 3 +-
.../prepare_datasets/2-get-hubert-wav32k.py | 3 +-
GPT_SoVITS/prepare_datasets/3-get-semantic.py | 3 +-
GPT_SoVITS/utils.py | 6 +-
README.md | 4 +-
docs/cn/README.md | 4 +-
docs/ja/README.md | 2 +-
docs/ko/README.md | 2 +-
docs/tr/README.md | 2 +-
tools/i18n/locale/en_US.json | 12 +-
tools/i18n/locale/es_ES.json | 14 +-
tools/i18n/locale/fr_FR.json | 14 +-
tools/i18n/locale/it_IT.json | 14 +-
tools/i18n/locale/ja_JP.json | 14 +-
tools/i18n/locale/ko_KR.json | 14 +-
tools/i18n/locale/pt_BR.json | 14 +-
tools/i18n/locale/ru_RU.json | 14 +-
tools/i18n/locale/tr_TR.json | 14 +-
tools/i18n/locale/zh_CN.json | 12 +-
tools/i18n/locale/zh_HK.json | 14 +-
tools/i18n/locale/zh_SG.json | 14 +-
tools/i18n/locale/zh_TW.json | 14 +-
tools/my_utils.py | 87 +++++-
tools/uvr5/webui.py | 29 +-
webui.py | 290 ++++++++++--------
27 files changed, 447 insertions(+), 181 deletions(-)
diff --git a/GPT_SoVITS/download.py b/GPT_SoVITS/download.py
index b6393e2..e7c8c97 100644
--- a/GPT_SoVITS/download.py
+++ b/GPT_SoVITS/download.py
@@ -1,5 +1,5 @@
import os, sys
now_dir = os.getcwd()
sys.path.insert(0, now_dir)
-from .text.g2pw import G2PWPinyin
+from text.g2pw import G2PWPinyin
g2pw = G2PWPinyin(model_dir="GPT_SoVITS/text/G2PWModel",model_source="GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large",v_to_u=False, neutral_tone_with_five=True)
\ No newline at end of file
diff --git a/GPT_SoVITS/inference_webui.py b/GPT_SoVITS/inference_webui.py
index 878f8d8..0681712 100644
--- a/GPT_SoVITS/inference_webui.py
+++ b/GPT_SoVITS/inference_webui.py
@@ -695,13 +695,14 @@ with gr.Blocks(title="GPT-SoVITS WebUI") as app:
with gr.Row():
inp_ref = gr.Audio(label=i18n("请上传3~10秒内参考音频,超过会报错!"), type="filepath", scale=13)
with gr.Column(scale=13):
- ref_text_free = gr.Checkbox(label=i18n("开启无参考文本模式。不填参考文本亦相当于开启。"), value=False, interactive=True, show_label=True)
+ ref_text_free = gr.Checkbox(label=i18n("开启无参考文本模式。不填参考文本亦相当于开启。"), value=False, interactive=True, show_label=True,scale=1)
gr.Markdown(html_left(i18n("使用无参考文本模式时建议使用微调的GPT,听不清参考音频说的啥(不晓得写啥)可以开。
开启后无视填写的参考文本。")))
- prompt_text = gr.Textbox(label=i18n("参考音频的文本"), value="", lines=3, max_lines=3)
- prompt_language = gr.Dropdown(
- label=i18n("参考音频的语种"), choices=list(dict_language.keys()), value=i18n("中文"), scale=14
- )
- inp_refs = gr.File(label=i18n("可选项:通过拖拽多个文件上传多个参考音频(建议同性),平均融合他们的音色。如不填写此项,音色由左侧单个参考音频控制。如是微调模型,建议参考音频全部在微调训练集音色内,底模不用管。"),file_count="file_count",scale=13)
+ prompt_text = gr.Textbox(label=i18n("参考音频的文本"), value="", lines=5, max_lines=5,scale=1)
+ with gr.Column(scale=14):
+ prompt_language = gr.Dropdown(
+ label=i18n("参考音频的语种"), choices=list(dict_language.keys()), value=i18n("中文"),
+ )
+ inp_refs = gr.File(label=i18n("可选项:通过拖拽多个文件上传多个参考音频(建议同性),平均融合他们的音色。如不填写此项,音色由左侧单个参考音频控制。如是微调模型,建议参考音频全部在微调训练集音色内,底模不用管。"),file_count="multiple")
gr.Markdown(html_center(i18n("*请填写需要合成的目标文本和语种模式"),'h3'))
with gr.Row():
with gr.Column(scale=13):
diff --git a/GPT_SoVITS/prepare_datasets/1-get-text.py b/GPT_SoVITS/prepare_datasets/1-get-text.py
index 7af6c10..bdeacc7 100644
--- a/GPT_SoVITS/prepare_datasets/1-get-text.py
+++ b/GPT_SoVITS/prepare_datasets/1-get-text.py
@@ -7,7 +7,8 @@ inp_wav_dir = os.environ.get("inp_wav_dir")
exp_name = os.environ.get("exp_name")
i_part = os.environ.get("i_part")
all_parts = os.environ.get("all_parts")
-os.environ["CUDA_VISIBLE_DEVICES"] = os.environ.get("_CUDA_VISIBLE_DEVICES")
+if "_CUDA_VISIBLE_DEVICES" in os.environ:
+ os.environ["CUDA_VISIBLE_DEVICES"] = os.environ["_CUDA_VISIBLE_DEVICES"]
opt_dir = os.environ.get("opt_dir")
bert_pretrained_dir = os.environ.get("bert_pretrained_dir")
import torch
diff --git a/GPT_SoVITS/prepare_datasets/2-get-hubert-wav32k.py b/GPT_SoVITS/prepare_datasets/2-get-hubert-wav32k.py
index 82f3c69..27b61f2 100644
--- a/GPT_SoVITS/prepare_datasets/2-get-hubert-wav32k.py
+++ b/GPT_SoVITS/prepare_datasets/2-get-hubert-wav32k.py
@@ -6,7 +6,8 @@ inp_wav_dir= os.environ.get("inp_wav_dir")
exp_name= os.environ.get("exp_name")
i_part= os.environ.get("i_part")
all_parts= os.environ.get("all_parts")
-os.environ["CUDA_VISIBLE_DEVICES"]= os.environ.get("_CUDA_VISIBLE_DEVICES")
+if "_CUDA_VISIBLE_DEVICES" in os.environ:
+ os.environ["CUDA_VISIBLE_DEVICES"] = os.environ["_CUDA_VISIBLE_DEVICES"]
from feature_extractor import cnhubert
opt_dir= os.environ.get("opt_dir")
cnhubert.cnhubert_base_path= os.environ.get("cnhubert_base_dir")
diff --git a/GPT_SoVITS/prepare_datasets/3-get-semantic.py b/GPT_SoVITS/prepare_datasets/3-get-semantic.py
index bbf7688..a29a662 100644
--- a/GPT_SoVITS/prepare_datasets/3-get-semantic.py
+++ b/GPT_SoVITS/prepare_datasets/3-get-semantic.py
@@ -4,7 +4,8 @@ inp_text = os.environ.get("inp_text")
exp_name = os.environ.get("exp_name")
i_part = os.environ.get("i_part")
all_parts = os.environ.get("all_parts")
-os.environ["CUDA_VISIBLE_DEVICES"] = os.environ.get("_CUDA_VISIBLE_DEVICES")
+if "_CUDA_VISIBLE_DEVICES" in os.environ:
+ os.environ["CUDA_VISIBLE_DEVICES"] = os.environ["_CUDA_VISIBLE_DEVICES"]
opt_dir = os.environ.get("opt_dir")
pretrained_s2G = os.environ.get("pretrained_s2G")
s2config_path = os.environ.get("s2config_path")
diff --git a/GPT_SoVITS/utils.py b/GPT_SoVITS/utils.py
index 7984b5a..177eda1 100644
--- a/GPT_SoVITS/utils.py
+++ b/GPT_SoVITS/utils.py
@@ -18,7 +18,7 @@ logging.getLogger("matplotlib").setLevel(logging.ERROR)
MATPLOTLIB_FLAG = False
-logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
+logging.basicConfig(stream=sys.stdout, level=logging.ERROR)
logger = logging
@@ -319,13 +319,13 @@ def check_git_hash(model_dir):
def get_logger(model_dir, filename="train.log"):
global logger
logger = logging.getLogger(os.path.basename(model_dir))
- logger.setLevel(logging.DEBUG)
+ logger.setLevel(logging.ERROR)
formatter = logging.Formatter("%(asctime)s\t%(name)s\t%(levelname)s\t%(message)s")
if not os.path.exists(model_dir):
os.makedirs(model_dir)
h = logging.FileHandler(os.path.join(model_dir, filename))
- h.setLevel(logging.DEBUG)
+ h.setLevel(logging.ERROR)
h.setFormatter(formatter)
logger.addHandler(h)
return logger
diff --git a/README.md b/README.md
index 5b40d5b..a0c0653 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ A Powerful Few-shot Voice Conversion and Text-to-Speech WebUI.
2. **Few-shot TTS:** Fine-tune the model with just 1 minute of training data for improved voice similarity and realism.
-3. **Cross-lingual Support:** Inference in languages different from the training dataset, currently supporting English, Japanese, and Chinese.
+3. **Cross-lingual Support:** Inference in languages different from the training dataset, currently supporting English, Japanese, Korean, Cantonese and Chinese.
4. **WebUI Tools:** Integrated tools include voice accompaniment separation, automatic training set segmentation, Chinese ASR, and text labeling, assisting beginners in creating training datasets and GPT/SoVITS models.
@@ -99,7 +99,7 @@ conda install -c conda-forge 'ffmpeg<7'
Download and place [ffmpeg.exe](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe) and [ffprobe.exe](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe) in the GPT-SoVITS root.
-Install [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) (Korean TTS Only)
+Install [Visual Studio 2017](https://aka.ms/vs/17/release/vc_redist.x86.exe) (Korean TTS Only)
##### MacOS Users
```bash
diff --git a/docs/cn/README.md b/docs/cn/README.md
index 8c86b48..d2f45b3 100644
--- a/docs/cn/README.md
+++ b/docs/cn/README.md
@@ -24,7 +24,7 @@
2. **少样本 TTS:** 仅需 1 分钟的训练数据即可微调模型,提升声音相似度和真实感。
-3. **跨语言支持:** 支持与训练数据集不同语言的推理,目前支持英语、日语和中文。
+3. **跨语言支持:** 支持与训练数据集不同语言的推理,目前支持英语、日语、韩语、粤语和中文。
4. **WebUI 工具:** 集成工具包括声音伴奏分离、自动训练集分割、中文自动语音识别(ASR)和文本标注,协助初学者创建训练数据集和 GPT/SoVITS 模型。
@@ -99,7 +99,7 @@ conda install -c conda-forge 'ffmpeg<7'
下载并将 [ffmpeg.exe](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe) 和 [ffprobe.exe](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe) 放置在 GPT-SoVITS 根目录下。
-安装 [Visual Studio 2022](https://visualstudio.microsoft.com/zh-hans/downloads/) 环境(仅限韩语TTS)
+安装 [Visual Studio 2017](https://aka.ms/vs/17/release/vc_redist.x86.exe) 环境(仅限韩语TTS)
##### MacOS 用户
```bash
diff --git a/docs/ja/README.md b/docs/ja/README.md
index 35852a9..5d01fad 100644
--- a/docs/ja/README.md
+++ b/docs/ja/README.md
@@ -24,7 +24,7 @@
2. **数ショット TTS:** わずか 1 分間のトレーニングデータでモデルを微調整し、音声の類似性とリアリズムを向上。
-3. **多言語サポート:** 現在、英語、日本語、中国語をサポートしています。
+3. **多言語サポート:** 現在、英語、日本語、韓語、粵語、中国語をサポートしています。
4. **WebUI ツール:** 統合されたツールには、音声伴奏の分離、トレーニングセットの自動セグメンテーション、中国語 ASR、テキストラベリングが含まれ、初心者がトレーニングデータセットと GPT/SoVITS モデルを作成するのを支援します。
diff --git a/docs/ko/README.md b/docs/ko/README.md
index 31783cc..c0ac9a2 100644
--- a/docs/ko/README.md
+++ b/docs/ko/README.md
@@ -24,7 +24,7 @@
2. **소량의 데이터 TTS:** 1분의 훈련 데이터만으로 모델을 미세 조정하여 음성 유사도와 실제감을 향상시킬 수 있습니다.
-3. **다국어 지원:** 훈련 데이터셋과 다른 언어의 추론을 지원하며, 현재 영어, 일본어, 중국어를 지원합니다.
+3. **다국어 지원:** 훈련 데이터셋과 다른 언어의 추론을 지원하며, 현재 영어, 일본어, 중국어, 광둥어, 한국어를 지원합니다.
4. **WebUI 도구:** 음성 반주 분리, 자동 훈련 데이터셋 분할, 중국어 자동 음성 인식(ASR) 및 텍스트 주석 등의 도구를 통합하여 초보자가 훈련 데이터셋과 GPT/SoVITS 모델을 생성하는 데 도움을 줍니다.
diff --git a/docs/tr/README.md b/docs/tr/README.md
index 32210c3..6eddaeb 100644
--- a/docs/tr/README.md
+++ b/docs/tr/README.md
@@ -24,7 +24,7 @@ Güçlü Birkaç Örnekli Ses Dönüştürme ve Metinden Konuşmaya Web Arayüz
2. **Birkaç Örnekli Metinden Konuşmaya:** Daha iyi ses benzerliği ve gerçekçiliği için modeli yalnızca 1 dakikalık eğitim verisiyle ince ayarlayın.
-3. **Çapraz Dil Desteği:** Eğitim veri setinden farklı dillerde çıkarım, şu anda İngilizce, Japonca ve Çinceyi destekliyor.
+3. **Çapraz Dil Desteği:** Eğitim veri setinden farklı dillerde çıkarım, şu anda İngilizce, Japonca, Çince, Kantonca ve Koreceyi destekliyor.
4. **Web Arayüzü Araçları:** Entegre araçlar arasında vokal eşliğinde ayırma, otomatik eğitim seti segmentasyonu, Çince ASR ve metin etiketleme bulunur ve yeni başlayanların eğitim veri setleri ve GPT/SoVITS modelleri oluşturmalarına yardımcı olur.
diff --git a/tools/i18n/locale/en_US.json b/tools/i18n/locale/en_US.json
index ab02320..283403f 100644
--- a/tools/i18n/locale/en_US.json
+++ b/tools/i18n/locale/en_US.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "Pretrained SSL model path",
"预训练的SoVITS-D模型路径": "Pretrained SoVITS-D model path",
"预训练的SoVITS-G模型路径": "Pretrained SoVITS-G model path",
- "预训练的中文BERT模型路径": " Pretrained BERT model path"
+ "预训练的中文BERT模型路径": " Pretrained BERT model path",
+ "音频加载失败": "Failed to Load Audio",
+ "以下文件或文件夹不存在": "No Such File or Folder",
+ "路径不能为空": "Expected No Empty Path",
+ "请填入正确的List路径": "Please Fill in the Correct List Path",
+ "请填入正确的音频文件夹路径": "Please Fill in the Correct Audio Folder Path",
+ "路径错误": "Path Error",
+ "缺少音素数据集": "Missing Phoneme Dataset",
+ "缺少Hubert数据集": "Missing Hubert Dataset",
+ "缺少音频数据集": "Missing Audio Dataset",
+ "缺少语义数据集": "Missing Semantics Dataset"
}
diff --git a/tools/i18n/locale/es_ES.json b/tools/i18n/locale/es_ES.json
index 7d3e64c..739582b 100644
--- a/tools/i18n/locale/es_ES.json
+++ b/tools/i18n/locale/es_ES.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "Ruta del modelo SSL preentrenado",
"预训练的SoVITS-D模型路径": "Ruta del modelo SoVITS-D preentrenado",
"预训练的SoVITS-G模型路径": "Ruta del modelo SoVITS-G preentrenado",
- "预训练的中文BERT模型路径": "Ruta del modelo BERT en chino preentrenado"
-}
+ "预训练的中文BERT模型路径": "Ruta del modelo BERT en chino preentrenado",
+ "音频加载失败": "Error al Cargar el Audio",
+ "以下文件或文件夹不存在": "No Existe Tal Archivo o Carpeta",
+ "路径不能为空": "Se Espera que la Ruta No Esté Vacía",
+ "请填入正确的List路径": "Por Favor, Introduzca la Ruta Correcta de la Lista",
+ "请填入正确的音频文件夹路径": "Por Favor, Introduzca la Ruta Correcta de la Carpeta de Audio",
+ "路径错误": "Error de Ruta",
+ "缺少音素数据集": "Falta el Conjunto de Datos de Fonemas",
+ "缺少Hubert数据集": "Falta el Conjunto de Datos de Hubert",
+ "缺少音频数据集": "Falta el Conjunto de Datos de Audio",
+ "缺少语义数据集": "Falta el Conjunto de Datos Semánticos"
+}
\ No newline at end of file
diff --git a/tools/i18n/locale/fr_FR.json b/tools/i18n/locale/fr_FR.json
index 8763a25..3ee2c3c 100644
--- a/tools/i18n/locale/fr_FR.json
+++ b/tools/i18n/locale/fr_FR.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "Chemin du modèle SSL pré-entraîné",
"预训练的SoVITS-D模型路径": "Chemin du modèle SoVITS-D pré-entraîné",
"预训练的SoVITS-G模型路径": "Chemin du modèle SoVITS-G pré-entraîné",
- "预训练的中文BERT模型路径": "Chemin du modèle BERT chinois pré-entraîné"
-}
+ "预训练的中文BERT模型路径": "Chemin du modèle BERT chinois pré-entraîné",
+ "音频加载失败": "Échec du Chargement de l'Audio",
+ "以下文件或文件夹不存在": "Aucun Fichier ou Dossier de ce Type",
+ "路径不能为空": "Chemin Non Vide Attendu",
+ "请填入正确的List路径": "Veuillez Remplir le Chemin Correct de la Liste",
+ "请填入正确的音频文件夹路径": "Veuillez Remplir le Chemin Correct du Dossier Audio",
+ "路径错误": "Erreur de Chemin",
+ "缺少音素数据集": "Jeu de Données de Phonèmes Manquant",
+ "缺少Hubert数据集": "Jeu de Données Hubert Manquant",
+ "缺少音频数据集": "Jeu de Données Audio Manquant",
+ "缺少语义数据集": "Jeu de Données Sémantiques Manquant"
+}
\ No newline at end of file
diff --git a/tools/i18n/locale/it_IT.json b/tools/i18n/locale/it_IT.json
index 5203e44..f4b8897 100644
--- a/tools/i18n/locale/it_IT.json
+++ b/tools/i18n/locale/it_IT.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "Percorso del modello SSL preaddestrato",
"预训练的SoVITS-D模型路径": "Percorso del modello preaddestrato SoVITS-D",
"预训练的SoVITS-G模型路径": "Percorso del modello preaddestrato SoVITS-G",
- "预训练的中文BERT模型路径": "Percorso del modello BERT cinese preaddestrato"
-}
+ "预训练的中文BERT模型路径": "Percorso del modello BERT cinese preaddestrato",
+ "音频加载失败": "Caricamento Audio Fallito",
+ "以下文件或文件夹不存在": "Nessun File o Cartella di Questo Tipo",
+ "路径不能为空": "Percorso Vuoto Non Consentito",
+ "请填入正确的List路径": "Si Prega di Inserire il Percorso Corretto della Lista",
+ "请填入正确的音频文件夹路径": "Si Prega di Inserire il Percorso Corretto della Cartella Audio",
+ "路径错误": "Errore di Percorso",
+ "缺少音素数据集": "Dataset di Fonemi Mancante",
+ "缺少Hubert数据集": "Dataset di Hubert Mancante",
+ "缺少音频数据集": "Dataset Audio Mancante",
+ "缺少语义数据集": "Dataset Semantico Mancante"
+}
\ No newline at end of file
diff --git a/tools/i18n/locale/ja_JP.json b/tools/i18n/locale/ja_JP.json
index 719ae07..5edd3eb 100644
--- a/tools/i18n/locale/ja_JP.json
+++ b/tools/i18n/locale/ja_JP.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "事前にトレーニングされたSSLモデルのパス",
"预训练的SoVITS-D模型路径": "事前にトレーニングされたSoVITS-Dモデルのパス",
"预训练的SoVITS-G模型路径": "事前にトレーニングされたSoVITS-Gモデルのパス",
- "预训练的中文BERT模型路径": "事前にトレーニングされた中文BERTモデルのパス"
-}
+ "预训练的中文BERT模型路径": "事前にトレーニングされた中文BERTモデルのパス",
+ "音频加载失败": "音声の読み込みに失敗しました",
+ "以下文件或文件夹不存在": "そのようなファイルまたはフォルダは存在しません",
+ "路径不能为空": "空のパスは予期されていません",
+ "请填入正确的List路径": "正しいリストパスを入力してください",
+ "请填入正确的音频文件夹路径": "正しいオーディオフォルダパスを入力してください",
+ "路径错误": "パスエラー",
+ "缺少音素数据集": "音素データセットが欠落しています",
+ "缺少Hubert数据集": "Hubertデータセットが欠落しています",
+ "缺少音频数据集": "オーディオデータセットが欠落しています",
+ "缺少语义数据集": "セマンティクスデータセットが欠落しています"
+}
\ No newline at end of file
diff --git a/tools/i18n/locale/ko_KR.json b/tools/i18n/locale/ko_KR.json
index ba36046..062ffd0 100644
--- a/tools/i18n/locale/ko_KR.json
+++ b/tools/i18n/locale/ko_KR.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "사전 훈련된 SSL 모델 경로",
"预训练的SoVITS-D模型路径": "사전 훈련된 SoVITS-D 모델 경로",
"预训练的SoVITS-G模型路径": "사전 훈련된 SoVITS-G 모델 경로",
- "预训练的中文BERT模型路径": "사전 훈련된 중국어 BERT 모델 경로"
-}
+ "预训练的中文BERT模型路径": "사전 훈련된 중국어 BERT 모델 경로",
+ "音频加载失败": "오디오 로드 실패",
+ "以下文件或文件夹不存在": "해당 파일이나 폴더가 없습니다",
+ "路径不能为空": "경로가 비어 있을 수 없습니다",
+ "请填入正确的List路径": "올바른 리스트 경로를 입력하세요",
+ "请填入正确的音频文件夹路径": "올바른 오디오 폴더 경로를 입력하세요",
+ "路径错误": "경로 오류",
+ "缺少音素数据集": "음소 데이터셋이 없습니다",
+ "缺少Hubert数据集": "Hubert 데이터셋이 없습니다",
+ "缺少音频数据集": "오디오 데이터셋이 없습니다",
+ "缺少语义数据集": "의미론 데이터셋이 없습니다"
+}
\ No newline at end of file
diff --git a/tools/i18n/locale/pt_BR.json b/tools/i18n/locale/pt_BR.json
index 5b2ac5f..3fd1899 100644
--- a/tools/i18n/locale/pt_BR.json
+++ b/tools/i18n/locale/pt_BR.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "Caminho do modelo SSL pre-train",
"预训练的SoVITS-D模型路径": "Caminho do modelo SoVITS-D pre-train",
"预训练的SoVITS-G模型路径": "Caminho do modelo SoVITS-G pre-train",
- "预训练的中文BERT模型路径": "Caminho do modelo BERT chinês pre-train"
-}
+ "预训练的中文BERT模型路径": "Caminho do modelo BERT chinês pre-train",
+ "音频加载失败": "Falha ao Carregar o Áudio",
+ "以下文件或文件夹不存在": "Nenhum Arquivo ou Pasta Encontrado",
+ "路径不能为空": "Esperado Caminho Não Vazio",
+ "请填入正确的List路径": "Por Favor, Insira o Caminho Correto da Lista",
+ "请填入正确的音频文件夹路径": "Por Favor, Insira o Caminho Correto da Pasta de Áudio",
+ "路径错误": "Erro de Caminho",
+ "缺少音素数据集": "Conjunto de Dados de Fonemas Ausente",
+ "缺少Hubert数据集": "Conjunto de Dados Hubert Ausente",
+ "缺少音频数据集": "Conjunto de Dados de Áudio Ausente",
+ "缺少语义数据集": "Conjunto de Dados Semânticos Ausente"
+}
\ No newline at end of file
diff --git a/tools/i18n/locale/ru_RU.json b/tools/i18n/locale/ru_RU.json
index ea44606..c8046ec 100644
--- a/tools/i18n/locale/ru_RU.json
+++ b/tools/i18n/locale/ru_RU.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "Путь к предварительно обученной модели SSL",
"预训练的SoVITS-D模型路径": "Путь к предварительно обученной модели SoVITS-D",
"预训练的SoVITS-G模型路径": "Путь к предварительно обученной модели SoVITS-G",
- "预训练的中文BERT模型路径": "Путь к предварительно обученной китайской модели BERT"
-}
+ "预训练的中文BERT模型路径": "Путь к предварительно обученной китайской модели BERT",
+ "音频加载失败": "Не удалось загрузить аудио",
+ "以下文件或文件夹不存在": "Такого файла или папки не существует",
+ "路径不能为空": "Ожидается, что путь не будет пустым",
+ "请填入正确的List路径": "Пожалуйста, укажите правильный путь к списку",
+ "请填入正确的音频文件夹路径": "Пожалуйста, укажите правильный путь к папке с аудио",
+ "路径错误": "Ошибка пути",
+ "缺少音素数据集": "Отсутствует набор данных фонем",
+ "缺少Hubert数据集": "Отсутствует набор данных Hubert",
+ "缺少音频数据集": "Отсутствует набор данных аудио",
+ "缺少语义数据集": "Отсутствует семантический набор данных"
+}
\ No newline at end of file
diff --git a/tools/i18n/locale/tr_TR.json b/tools/i18n/locale/tr_TR.json
index c9e0cc2..733e3c8 100644
--- a/tools/i18n/locale/tr_TR.json
+++ b/tools/i18n/locale/tr_TR.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "Ön eğitilmiş SSL model yolu",
"预训练的SoVITS-D模型路径": "Ön eğitilmiş SoVITS-D model yolu",
"预训练的SoVITS-G模型路径": "Ön eğitilmiş SoVITS-G model yolu",
- "预训练的中文BERT模型路径": "Ön eğitilmiş Çince BERT model yolu"
-}
+ "预训练的中文BERT模型路径": "Ön eğitilmiş Çince BERT model yolu",
+ "音频加载失败": "Ses Yüklenemedi",
+ "以下文件或文件夹不存在": "Böyle Bir Dosya veya Klasör Yok",
+ "路径不能为空": "Boş Yol Beklenmiyor",
+ "请填入正确的List路径": "Lütfen Doğru Liste Yolunu Girin",
+ "请填入正确的音频文件夹路径": "Lütfen Doğru Ses Klasörü Yolunu Girin",
+ "路径错误": "Yol Hatası",
+ "缺少音素数据集": "Fonem Veri Seti Eksik",
+ "缺少Hubert数据集": "Hubert Veri Seti Eksik",
+ "缺少音频数据集": "Ses Veri Seti Eksik",
+ "缺少语义数据集": "Anlamsal Veri Seti Eksik"
+}
\ No newline at end of file
diff --git a/tools/i18n/locale/zh_CN.json b/tools/i18n/locale/zh_CN.json
index 49eccf9..2ee0334 100644
--- a/tools/i18n/locale/zh_CN.json
+++ b/tools/i18n/locale/zh_CN.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "预训练的SSL模型路径",
"预训练的SoVITS-D模型路径": "预训练的SoVITS-D模型路径",
"预训练的SoVITS-G模型路径": "预训练的SoVITS-G模型路径",
- "预训练的中文BERT模型路径": "预训练的中文BERT模型路径"
+ "预训练的中文BERT模型路径": "预训练的中文BERT模型路径",
+ "音频加载失败": "音频加载失败",
+ "以下文件或文件夹不存在": "以下文件或文件夹不存在",
+ "路径不能为空": "路径不能为空",
+ "请填入正确的List路径": "请填入正确的List路径",
+ "请填入正确的音频文件夹路径": "请填入正确的音频文件夹路径",
+ "路径错误": "路径错误",
+ "缺少音素数据集": "缺少音素数据集",
+ "缺少Hubert数据集": "缺少Hubert数据集",
+ "缺少音频数据集": "缺少音频数据集",
+ "缺少语义数据集": "缺少语义数据集"
}
diff --git a/tools/i18n/locale/zh_HK.json b/tools/i18n/locale/zh_HK.json
index c70f6ee..65fd51c 100644
--- a/tools/i18n/locale/zh_HK.json
+++ b/tools/i18n/locale/zh_HK.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "預訓練的SSL模型路徑",
"预训练的SoVITS-D模型路径": "預訓練的SoVITS-D模型路徑",
"预训练的SoVITS-G模型路径": "預訓練的SoVITS-G模型路徑",
- "预训练的中文BERT模型路径": "預訓練的中文BERT模型路徑"
-}
+ "预训练的中文BERT模型路径": "預訓練的中文BERT模型路徑",
+ "音频加载失败": "無法加載音頻",
+ "以下文件或文件夹不存在": "沒有此文件或文件夾",
+ "路径不能为空": "路徑不應該為空",
+ "请填入正确的List路径": "請填寫正確的列表路徑",
+ "请填入正确的音频文件夹路径": "請填寫正確的音頻文件夾路徑",
+ "路径错误": "路徑錯誤",
+ "缺少音素数据集": "缺少音素數據集",
+ "缺少Hubert数据集": "缺少Hubert數據集",
+ "缺少音频数据集": "缺少音頻數據集",
+ "缺少语义数据集": "缺少語義數據集"
+}
\ No newline at end of file
diff --git a/tools/i18n/locale/zh_SG.json b/tools/i18n/locale/zh_SG.json
index 3ed0801..ada878d 100644
--- a/tools/i18n/locale/zh_SG.json
+++ b/tools/i18n/locale/zh_SG.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "預訓練的SSL模型路徑",
"预训练的SoVITS-D模型路径": "預訓練的SoVITS-D模型路徑",
"预训练的SoVITS-G模型路径": "預訓練的SoVITS-G模型路徑",
- "预训练的中文BERT模型路径": "預訓練的中文BERT模型路徑"
-}
+ "预训练的中文BERT模型路径": "預訓練的中文BERT模型路徑",
+ "音频加载失败": "無法加載音頻",
+ "以下文件或文件夹不存在": "沒有此文件或文件夾",
+ "路径不能为空": "路徑不應該為空",
+ "请填入正确的List路径": "請填寫正確的列表路徑",
+ "请填入正确的音频文件夹路径": "請填寫正確的音頻文件夾路徑",
+ "路径错误": "路徑錯誤",
+ "缺少音素数据集": "缺少音素數據集",
+ "缺少Hubert数据集": "缺少Hubert數據集",
+ "缺少音频数据集": "缺少音頻數據集",
+ "缺少语义数据集": "缺少語義數據集"
+}
\ No newline at end of file
diff --git a/tools/i18n/locale/zh_TW.json b/tools/i18n/locale/zh_TW.json
index 9e63896..13c09ec 100644
--- a/tools/i18n/locale/zh_TW.json
+++ b/tools/i18n/locale/zh_TW.json
@@ -174,5 +174,15 @@
"预训练的SSL模型路径": "預訓練的SSL模型路徑",
"预训练的SoVITS-D模型路径": "預訓練的SoVITS-D模型路徑",
"预训练的SoVITS-G模型路径": "預訓練的SoVITS-G模型路徑",
- "预训练的中文BERT模型路径": "預訓練的中文BERT模型路徑"
-}
+ "预训练的中文BERT模型路径": "預訓練的中文BERT模型路徑",
+ "音频加载失败": "無法加載音頻",
+ "以下文件或文件夹不存在": "沒有此文件或文件夾",
+ "路径不能为空": "路徑不應該為空",
+ "请填入正确的List路径": "請填寫正確的列表路徑",
+ "请填入正确的音频文件夹路径": "請填寫正確的音頻文件夾路徑",
+ "路径错误": "路徑錯誤",
+ "缺少音素数据集": "缺少音素數據集",
+ "缺少Hubert数据集": "缺少Hubert數據集",
+ "缺少音频数据集": "缺少音頻數據集",
+ "缺少语义数据集": "缺少語義數據集"
+}
\ No newline at end of file
diff --git a/tools/my_utils.py b/tools/my_utils.py
index 53544f8..cdb95e0 100644
--- a/tools/my_utils.py
+++ b/tools/my_utils.py
@@ -1,7 +1,10 @@
import platform,os,traceback
import ffmpeg
import numpy as np
-
+import gradio as gr
+from tools.i18n.i18n import I18nAuto
+import pandas as pd
+i18n = I18nAuto(language=os.environ.get('language','Auto'))
def load_audio(file, sr):
try:
@@ -20,7 +23,7 @@ def load_audio(file, sr):
)
except Exception as e:
traceback.print_exc()
- raise RuntimeError(f"Failed to load audio: {e}")
+ raise RuntimeError(i18n("音频加载失败"))
return np.frombuffer(out, np.float32).flatten()
@@ -30,3 +33,83 @@ def clean_path(path_str:str):
return clean_path(path_str[0:-1])
path_str = path_str.replace('/', os.sep).replace('\\', os.sep)
return path_str.strip(" ").strip('\'').strip("\n").strip('"').strip(" ").strip("\u202a")
+
+
+def check_for_existance(file_list:list=None,is_train=False,is_dataset_processing=False):
+ files_status=[]
+ if is_train == True and file_list:
+ file_list.append(os.path.join(file_list[0],'2-name2text.txt'))
+ file_list.append(os.path.join(file_list[0],'3-bert'))
+ file_list.append(os.path.join(file_list[0],'4-cnhubert'))
+ file_list.append(os.path.join(file_list[0],'5-wav32k'))
+ file_list.append(os.path.join(file_list[0],'6-name2semantic.tsv'))
+ for file in file_list:
+ if os.path.exists(file):files_status.append(True)
+ else:files_status.append(False)
+ if sum(files_status)!=len(files_status):
+ if is_train:
+ for file,status in zip(file_list,files_status):
+ if status:pass
+ else:gr.Warning(file)
+ gr.Warning(i18n('以下文件或文件夹不存在'))
+ return False
+ elif is_dataset_processing:
+ if files_status[0]:
+ return True
+ elif not files_status[0]:
+ gr.Warning(file_list[0])
+ elif not files_status[1] and file_list[1]:
+ gr.Warning(file_list[1])
+ gr.Warning(i18n('以下文件或文件夹不存在'))
+ return False
+ else:
+ if file_list[0]:
+ gr.Warning(file_list[0])
+ gr.Warning(i18n('以下文件或文件夹不存在'))
+ else:
+ gr.Warning(i18n('路径不能为空'))
+ return False
+ return True
+
+def check_details(path_list=None,is_train=False,is_dataset_processing=False):
+ if is_dataset_processing:
+ list_path, audio_path = path_list
+ if (not list_path.endswith('.list')):
+ gr.Warning(i18n('请填入正确的List路径'))
+ return
+ if audio_path:
+ if not os.path.isdir(audio_path):
+ gr.Warning(i18n('请填入正确的音频文件夹路径'))
+ return
+ with open(list_path,"r",encoding="utf8")as f:
+ line=f.readline().strip("\n").split("\n")
+ wav_name, _, __, ___ = line[0].split("|")
+ wav_name=clean_path(wav_name)
+ if (audio_path != "" and audio_path != None):
+ wav_name = os.path.basename(wav_name)
+ wav_path = "%s/%s"%(audio_path, wav_name)
+ else:
+ wav_path=wav_name
+ if os.path.exists(wav_path):
+ ...
+ else:
+ gr.Warning(i18n('路径错误'))
+ return
+ if is_train:
+ path_list.append(os.path.join(path_list[0],'2-name2text.txt'))
+ path_list.append(os.path.join(path_list[0],'4-cnhubert'))
+ path_list.append(os.path.join(path_list[0],'5-wav32k'))
+ path_list.append(os.path.join(path_list[0],'6-name2semantic.tsv'))
+ phone_path, hubert_path, wav_path, semantic_path = path_list[1:]
+ with open(phone_path,'r',encoding='utf-8') as f:
+ if f.read(1):...
+ else:gr.Warning(i18n('缺少音素数据集'))
+ if os.listdir(hubert_path):...
+ else:gr.Warning(i18n('缺少Hubert数据集'))
+ if os.listdir(wav_path):...
+ else:gr.Warning(i18n('缺少音频数据集'))
+ df = pd.read_csv(
+ semantic_path, delimiter="\t", encoding="utf-8"
+ )
+ if len(df) >= 1:...
+ else:gr.Warning(i18n('缺少语义数据集'))
diff --git a/tools/uvr5/webui.py b/tools/uvr5/webui.py
index 60dfdaa..d216f6b 100644
--- a/tools/uvr5/webui.py
+++ b/tools/uvr5/webui.py
@@ -25,6 +25,16 @@ is_half=eval(sys.argv[2])
webui_port_uvr5=int(sys.argv[3])
is_share=eval(sys.argv[4])
+def html_left(text, label='p'):
+ return f"""