mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2026-07-25 03:55:40 +08:00
Compare commits
3 Commits
5af6aa3781
...
7325b02155
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7325b02155 | ||
|
|
b2cff0cd0a | ||
|
|
76020a9206 |
@ -34,6 +34,8 @@ COPY install.sh /workspace/GPT-SoVITS/
|
||||
|
||||
RUN bash Docker/install_wrapper.sh
|
||||
|
||||
RUN apt-get update && apt-get install -y libnppicc-12 && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
EXPOSE 9871 9872 9873 9874 9880
|
||||
|
||||
ENV PYTHONPATH="/workspace/GPT-SoVITS"
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
# This code is modified from https://github.com/mozillazg/pypinyin-g2pW
|
||||
|
||||
import hashlib
|
||||
import pickle
|
||||
import os
|
||||
|
||||
@ -14,6 +15,16 @@ current_file_path = os.path.dirname(__file__)
|
||||
CACHE_PATH = os.path.join(current_file_path, "polyphonic.pickle")
|
||||
PP_DICT_PATH = os.path.join(current_file_path, "polyphonic.rep")
|
||||
PP_FIX_DICT_PATH = os.path.join(current_file_path, "polyphonic-fix.rep")
|
||||
MD5_PATH = os.path.join(current_file_path, "polyphonic.md5")
|
||||
|
||||
def get_file_md5(file_path):
|
||||
if not os.path.exists(file_path):
|
||||
return ""
|
||||
hasher = hashlib.md5()
|
||||
with open(file_path, "rb") as f:
|
||||
for chunk in iter(lambda: f.read(4096), b""):
|
||||
hasher.update(chunk)
|
||||
return hasher.hexdigest()
|
||||
|
||||
|
||||
class G2PWPinyin(Pinyin):
|
||||
@ -115,13 +126,22 @@ def cache_dict(polyphonic_dict, file_path):
|
||||
|
||||
|
||||
def get_dict():
|
||||
if os.path.exists(CACHE_PATH):
|
||||
new_md5 = get_file_md5(PP_DICT_PATH) + get_file_md5(PP_FIX_DICT_PATH)
|
||||
old_md5 = ""
|
||||
if os.path.exists(MD5_PATH):
|
||||
with open(MD5_PATH, "r", encoding="utf-8") as f:
|
||||
old_md5 = f.read().strip()
|
||||
need_rebuild = (not os.path.exists(CACHE_PATH)) or (new_md5 != old_md5)
|
||||
|
||||
if not need_rebuild:
|
||||
with open(CACHE_PATH, "rb") as pickle_file:
|
||||
polyphonic_dict = pickle.load(pickle_file)
|
||||
else:
|
||||
print("Rebuilding Polyphonic Dictionary: " + f"{old_md5} -> {new_md5}")
|
||||
polyphonic_dict = read_dict()
|
||||
cache_dict(polyphonic_dict, CACHE_PATH)
|
||||
|
||||
with open(MD5_PATH, "w", encoding="utf-8") as f:
|
||||
f.write(new_md5)
|
||||
return polyphonic_dict
|
||||
|
||||
|
||||
|
||||
@ -45023,4 +45023,5 @@
|
||||
鼎铛玉石: ['ding3', 'cheng1', 'yu4', 'shi2']
|
||||
齿豁头童: ['chi3', 'huo1', 'tou2', 'tong2']
|
||||
牦牛: ['mao2', 'niu2']
|
||||
牦: ['mao2']
|
||||
牦: ['mao2']
|
||||
唑: ['zuo4']
|
||||
1
GPT_SoVITS/text/g2pw/polyphonic.md5
Normal file
1
GPT_SoVITS/text/g2pw/polyphonic.md5
Normal file
@ -0,0 +1 @@
|
||||
13b2211c317c75794123ffdf7c2aea021c75b0c606ad61d7c8b05bb00b64fa21
|
||||
Binary file not shown.
@ -326,17 +326,17 @@ fi
|
||||
if [ "$USE_CUDA" = true ] && [ "$WORKFLOW" = false ]; then
|
||||
if [ "$CUDA" = 128 ]; then
|
||||
echo -e "${INFO}Installing PyTorch For CUDA 12.8..."
|
||||
run_pip_quiet torch torchcodec --index-url "https://download.pytorch.org/whl/cu128"
|
||||
run_pip_quiet torch torchaudio torchcodec --index-url "https://download.pytorch.org/whl/cu128"
|
||||
elif [ "$CUDA" = 126 ]; then
|
||||
echo -e "${INFO}Installing PyTorch For CUDA 12.6..."
|
||||
run_pip_quiet torch torchcodec --index-url "https://download.pytorch.org/whl/cu126"
|
||||
run_pip_quiet torch torchaudio torchcodec --index-url "https://download.pytorch.org/whl/cu126"
|
||||
fi
|
||||
elif [ "$USE_ROCM" = true ] && [ "$WORKFLOW" = false ]; then
|
||||
echo -e "${INFO}Installing PyTorch For ROCm 6.2..."
|
||||
run_pip_quiet torch torchcodec --index-url "https://download.pytorch.org/whl/rocm6.2"
|
||||
run_pip_quiet torch torchaudio torchcodec --index-url "https://download.pytorch.org/whl/rocm6.2"
|
||||
elif [ "$USE_CPU" = true ] && [ "$WORKFLOW" = false ]; then
|
||||
echo -e "${INFO}Installing PyTorch For CPU..."
|
||||
run_pip_quiet torch torchcodec --index-url "https://download.pytorch.org/whl/cpu"
|
||||
run_pip_quiet torch torchaudio torchcodec --index-url "https://download.pytorch.org/whl/cpu"
|
||||
elif [ "$WORKFLOW" = false ]; then
|
||||
echo -e "${ERROR}Unknown Err"
|
||||
exit 1
|
||||
|
||||
@ -15,7 +15,6 @@ cn2an
|
||||
pypinyin
|
||||
pyopenjtalk>=0.4.1
|
||||
g2p_en
|
||||
torchaudio
|
||||
modelscope
|
||||
sentencepiece
|
||||
transformers>=4.43,<=4.50
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user