Skip to content

Commit 7790eb8

Browse files
committed
add download_model.sh
1 parent 93a67e7 commit 7790eb8

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

download_model.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/bin/bash
2+
3+
echo "All required tools are installed"
4+
wget -v
5+
if [ $? -ne 0 ]; then
6+
echo "wget is not installed"
7+
exit 1
8+
fi
9+
10+
unzip -v
11+
if [ $? -ne 0 ]; then
12+
echo "unzip is not installed"
13+
exit 1
14+
fi
15+
16+
echo "Download model files"
17+
18+
echo "Download GPT_Sovits common model files"
19+
wget https://huggingface.co/L-jasmine/GPT_Sovits/resolve/main/resource.zip
20+
unzip resource.zip
21+
22+
echo "Download GPT_Sovits g2pw model"
23+
wget https://huggingface.co/L-jasmine/GPT_Sovits/resolve/main/g2pw.pt
24+
mv g2pw.pt resource
25+
26+
echo "Download GPT_Sovits mini-bart-g2p model"
27+
wget https://huggingface.co/L-jasmine/GPT_Sovits/resolve/main/mini-bart-g2p.pt
28+
mv mini-bart-g2p.pt resource
29+
30+
echo "Download GPT_Sovits voice model"
31+
wget https://huggingface.co/L-jasmine/GPT_Sovits/resolve/main/cooper.zip
32+
unzip cooper.zip
33+
wget https://huggingface.co/L-jasmine/GPT_Sovits/resolve/main/kelly.zip
34+
unzip kelly.zip
35+
36+
if [ -f "tts-api-server.wasm" ]; then
37+
echo "Download tts-api-server.wasm"
38+
wget https://github.com/LlamaEdge/tts-api-server/releases/download/0.2.0/tts-api-server_gpt-sovits.wasm -O tts-api-server.wasm
39+
fi
40+
41+
echo "If plugin is not installed, please install it manually. Goto https://github.com/second-state/gpt_sovits_plugin"
42+
43+
wget https://raw.githubusercontent.com/second-state/gpt_sovits_rs/refs/heads/main/resource/zh_word_dict.json
44+
echo '{}' > en_word_dict.json
45+
46+
echo "Generate GPT_Sovits config.json"
47+
cat > config.json << EOF
48+
{
49+
"bert_model_path": "resource/bert_model.pt",
50+
"g2pw_model_path": "resource/g2pw_model.pt",
51+
"ssl_model_path": "resource/ssl_model.pt",
52+
"mini_bart_g2p_path": "resource/mini-bart-g2p.pt",
53+
"speaker": [
54+
{
55+
"name": "cooper",
56+
"gpt_sovits_path": "cooper/gpt_sovits_model.pt",
57+
"ref_audio_path": "cooper/ref.wav",
58+
"ref_text": "The birds are singing again. The sky is clearing."
59+
},
60+
{
61+
"name": "kelly",
62+
"gpt_sovits_path": "kelly/gpt_sovits_model.pt",
63+
"ref_audio_path": "kelly/ref.wav",
64+
"ref_text": "The whole case boils down to the same alleged scheme."
65+
}
66+
]
67+
}
68+
EOF
69+
70+
echo "export GPT_SOVITS_CONFIG_PATH=$(pwd)/config.json"
71+
echo "export GPT_SOVITS_DICT_PATH=$(pwd)"
72+
echo "# run tts-api-server"
73+
echo "wasmedge --dir .:. tts-api-server.wasm --model-name gpt_sovits --model gpt_sovits --config NA --espeak-ng-dir NA"

0 commit comments

Comments
 (0)