diff --git a/GPT_SoVITS/inference_webui_fast.py b/GPT_SoVITS/inference_webui_fast.py index 934cbe2..a91753d 100644 --- a/GPT_SoVITS/inference_webui_fast.py +++ b/GPT_SoVITS/inference_webui_fast.py @@ -50,7 +50,6 @@ bert_path = os.environ.get("bert_path", None) version = model_version = os.environ.get("version", "v2") import gradio as gr -from inference_webui import DictToAttrRecursive from TTS_infer_pack.text_segmentation_method import get_method from TTS_infer_pack.TTS import NO_PROMPT_ERROR, TTS, TTS_Config @@ -256,7 +255,7 @@ def get_weights_names(GPT_weight_root, SoVITS_weight_root): SoVITS_names, GPT_names = get_weights_names(GPT_weight_root, SoVITS_weight_root) -from process_ckpt import get_sovits_version_from_path_fast, load_sovits_new +from process_ckpt import get_sovits_version_from_path_fast def change_sovits_weights(sovits_path, prompt_language=None, text_language=None): diff --git a/GPT_SoVITS/text/g2pw/onnx_api.py b/GPT_SoVITS/text/g2pw/onnx_api.py index c175ec6..bf3109e 100644 --- a/GPT_SoVITS/text/g2pw/onnx_api.py +++ b/GPT_SoVITS/text/g2pw/onnx_api.py @@ -7,26 +7,20 @@ warnings.filterwarnings("ignore") import json import os import zipfile -import requests -from typing import Any -from typing import Dict -from typing import List -from typing import Tuple +from typing import Any, Dict, List, Tuple import numpy as np import onnxruntime +import requests onnxruntime.set_default_logger_severity(3) from opencc import OpenCC +from pypinyin import Style, pinyin from transformers import AutoTokenizer -from pypinyin import pinyin -from pypinyin import Style -from .dataset import get_char_phoneme_labels -from .dataset import get_phoneme_labels -from .dataset import prepare_onnx_input -from .utils import load_config from ..zh_normalization.char_convert import tranditional_to_simplified +from .dataset import get_char_phoneme_labels, get_phoneme_labels, prepare_onnx_input +from .utils import load_config model_version = "1.1" @@ -63,7 +57,7 @@ def download_and_decompress(model_dir: str = "G2PWModel/"): extract_dir = os.path.join(parent_directory, "G2PWModel_1.1") extract_dir_new = os.path.join(parent_directory, "G2PWModel") print("Downloading g2pw model...") - modelscope_url = "https://www.modelscope.cn/models/kamiorinn/g2pw/resolve/master/G2PWModel_1.1.zip"#"https://paddlespeech.cdn.bcebos.com/Parakeet/released_models/g2p/G2PWModel_1.1.zip" + modelscope_url = "https://www.modelscope.cn/models/kamiorinn/g2pw/resolve/master/G2PWModel_1.1.zip" # "https://paddlespeech.cdn.bcebos.com/Parakeet/released_models/g2p/G2PWModel_1.1.zip" with requests.get(modelscope_url, stream=True) as r: r.raise_for_status() with open(zip_dir, "wb") as f: