Spaces:
Runtime error
Runtime error
Commit
•
ff664dd
0
Parent(s):
Duplicate from Artrajz/vits-simple-api
Browse filesCo-authored-by: Artrajz <Artrajz@users.noreply.huggingface.co>
This view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +40 -0
- .gitignore +5 -0
- Dockerfile +36 -0
- Dockerfile_GPU +36 -0
- LICENSE +661 -0
- LICENSE-MoeGoe +21 -0
- Model/Bishojo_Mangekyo/config_mangekyo.json +36 -0
- Model/Bishojo_Mangekyo/generator_mangekyo.pth +3 -0
- Model/Cantonese/config.json +35 -0
- Model/Cantonese/model.pth +3 -0
- Model/Nene_Nanami_Rong_Tang/1374_epochs.pth +3 -0
- Model/Nene_Nanami_Rong_Tang/config.json +35 -0
- Model/genshin/G_953000.pth +3 -0
- Model/genshin/config.json +55 -0
- Model/hubert-soft-0d54a1f4.pt +3 -0
- Model/louise/360_epochs.pth +3 -0
- Model/louise/config.json +32 -0
- Model/model.onnx +3 -0
- Model/model.yaml +8 -0
- Model/npy/all_emotions.npy +3 -0
- Model/paimon/paimon6k.json +55 -0
- Model/paimon/paimon6k_390000.pth +3 -0
- Model/shanghainese/2796_epochs.pth +3 -0
- Model/shanghainese/config.json +35 -0
- Model/vctk/pretrained_vctk.pth +3 -0
- Model/vctk/vctk_base.json +55 -0
- Model/vits_chinese/bert_vits.json +55 -0
- Model/vits_chinese/vits_bert_model.pth +3 -0
- Model/w2v2-vits/1026_epochs.pth +3 -0
- Model/w2v2-vits/config.json +36 -0
- README.md +9 -0
- README_zh.md +618 -0
- app.py +546 -0
- bert_vits2/LICENSE +674 -0
- bert_vits2/README.md +5 -0
- bert_vits2/__init__.py +2 -0
- bert_vits2/attentions.py +352 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/.gitattributes +9 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/README.md +57 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/added_tokens.json +1 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/config.json +28 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/flax_model.msgpack +3 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/pytorch_model.bin +3 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/special_tokens_map.json +1 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/tf_model.h5 +3 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/tokenizer.json +0 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/tokenizer_config.json +1 -0
- bert_vits2/bert/chinese-roberta-wwm-ext-large/vocab.txt +0 -0
- bert_vits2/bert_vits2.py +86 -0
- bert_vits2/commons.py +161 -0
.gitattributes
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
chinese_dialect_lexicons/jyutjyu_2.ocd2 filter=lfs diff=lfs merge=lfs -text
|
36 |
+
chinese_dialect_lexicons/zaonhe_2.ocd2 filter=lfs diff=lfs merge=lfs -text
|
37 |
+
chinese_dialect_lexicons/zaonhe.ocd2 filter=lfs diff=lfs merge=lfs -text
|
38 |
+
vits/text/chinese_dialect_lexicons/jyutjyu_2.ocd2 filter=lfs diff=lfs merge=lfs -text
|
39 |
+
vits/text/chinese_dialect_lexicons/zaonhe_2.ocd2 filter=lfs diff=lfs merge=lfs -text
|
40 |
+
vits/text/chinese_dialect_lexicons/zaonhe.ocd2 filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
**/__pycache__
|
2 |
+
/Model/
|
3 |
+
/bert_vits2/monotonic_align/monotonic_align.egg-info/
|
4 |
+
/bert_vits2/monotonic_align/dist/
|
5 |
+
/bert_vits2/monotonic_align/build/
|
Dockerfile
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10.11-slim-bullseye
|
2 |
+
|
3 |
+
RUN mkdir -p /app
|
4 |
+
WORKDIR /app
|
5 |
+
|
6 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
7 |
+
|
8 |
+
COPY . /app
|
9 |
+
|
10 |
+
RUN apt-get update && \
|
11 |
+
apt-get install -yq build-essential espeak-ng cmake wget && \
|
12 |
+
apt-get clean && \
|
13 |
+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
|
14 |
+
rm -rf /var/lib/apt/lists/*
|
15 |
+
|
16 |
+
RUN pip install --upgrade pip --no-cache-dir && \
|
17 |
+
pip install MarkupSafe==2.1.2 numpy==1.23.3 cython six==1.16.0 safetensors==0.3.2 --no-cache-dir
|
18 |
+
|
19 |
+
RUN wget https://raw.githubusercontent.com/Artrajz/archived/main/openjtalk/openjtalk-0.3.0.dev2.tar.gz && \
|
20 |
+
tar -zxvf openjtalk-0.3.0.dev2.tar.gz && \
|
21 |
+
cd openjtalk-0.3.0.dev2 && \
|
22 |
+
rm -rf ./pyopenjtalk/open_jtalk_dic_utf_8-1.11 && \
|
23 |
+
python setup.py install && \
|
24 |
+
cd ../ && \
|
25 |
+
rm -f openjtalk-0.3.0.dev2.tar.gz && \
|
26 |
+
rm -rf openjtalk-0.3.0.dev2
|
27 |
+
|
28 |
+
RUN pip install torch --index-url https://download.pytorch.org/whl/cpu --no-cache-dir
|
29 |
+
|
30 |
+
RUN pip install -r requirements.txt --no-cache-dir
|
31 |
+
|
32 |
+
RUN pip install gunicorn --no-cache-dir
|
33 |
+
|
34 |
+
EXPOSE 23456
|
35 |
+
|
36 |
+
CMD ["gunicorn", "-c", "gunicorn_config.py", "app:app"]
|
Dockerfile_GPU
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10.11-slim-bullseye
|
2 |
+
|
3 |
+
RUN mkdir -p /app
|
4 |
+
WORKDIR /app
|
5 |
+
|
6 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
7 |
+
|
8 |
+
COPY . /app
|
9 |
+
|
10 |
+
RUN apt-get update && \
|
11 |
+
apt-get install -yq build-essential espeak-ng cmake wget && \
|
12 |
+
apt-get clean && \
|
13 |
+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
|
14 |
+
rm -rf /var/lib/apt/lists/*
|
15 |
+
|
16 |
+
RUN pip install --upgrade pip --no-cache-dir && \
|
17 |
+
pip install MarkupSafe==2.1.2 numpy==1.23.3 cython six==1.16.0 safetensors==0.3.2 --no-cache-dir
|
18 |
+
|
19 |
+
RUN wget https://raw.githubusercontent.com/Artrajz/archived/main/openjtalk/openjtalk-0.3.0.dev2.tar.gz && \
|
20 |
+
tar -zxvf openjtalk-0.3.0.dev2.tar.gz && \
|
21 |
+
cd openjtalk-0.3.0.dev2 && \
|
22 |
+
rm -rf ./pyopenjtalk/open_jtalk_dic_utf_8-1.11 && \
|
23 |
+
python setup.py install && \
|
24 |
+
cd ../ && \
|
25 |
+
rm -f openjtalk-0.3.0.dev2.tar.gz && \
|
26 |
+
rm -rf openjtalk-0.3.0.dev2
|
27 |
+
|
28 |
+
RUN pip install torch --index-url https://download.pytorch.org/whl/cu117 --no-cache-dir
|
29 |
+
|
30 |
+
RUN pip install -r requirements.txt --no-cache-dir
|
31 |
+
|
32 |
+
RUN pip install gunicorn --no-cache-dir
|
33 |
+
|
34 |
+
EXPOSE 23456
|
35 |
+
|
36 |
+
CMD ["gunicorn", "-c", "gunicorn_config.py", "app:app"]
|
LICENSE
ADDED
@@ -0,0 +1,661 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU AFFERO GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 19 November 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
6 |
+
of this license document, but changing it is not allowed.
|
7 |
+
|
8 |
+
Preamble
|
9 |
+
|
10 |
+
The GNU Affero General Public License is a free, copyleft license for
|
11 |
+
software and other kinds of works, specifically designed to ensure
|
12 |
+
cooperation with the community in the case of network server software.
|
13 |
+
|
14 |
+
The licenses for most software and other practical works are designed
|
15 |
+
to take away your freedom to share and change the works. By contrast,
|
16 |
+
our General Public Licenses are intended to guarantee your freedom to
|
17 |
+
share and change all versions of a program--to make sure it remains free
|
18 |
+
software for all its users.
|
19 |
+
|
20 |
+
When we speak of free software, we are referring to freedom, not
|
21 |
+
price. Our General Public Licenses are designed to make sure that you
|
22 |
+
have the freedom to distribute copies of free software (and charge for
|
23 |
+
them if you wish), that you receive source code or can get it if you
|
24 |
+
want it, that you can change the software or use pieces of it in new
|
25 |
+
free programs, and that you know you can do these things.
|
26 |
+
|
27 |
+
Developers that use our General Public Licenses protect your rights
|
28 |
+
with two steps: (1) assert copyright on the software, and (2) offer
|
29 |
+
you this License which gives you legal permission to copy, distribute
|
30 |
+
and/or modify the software.
|
31 |
+
|
32 |
+
A secondary benefit of defending all users' freedom is that
|
33 |
+
improvements made in alternate versions of the program, if they
|
34 |
+
receive widespread use, become available for other developers to
|
35 |
+
incorporate. Many developers of free software are heartened and
|
36 |
+
encouraged by the resulting cooperation. However, in the case of
|
37 |
+
software used on network servers, this result may fail to come about.
|
38 |
+
The GNU General Public License permits making a modified version and
|
39 |
+
letting the public access it on a server without ever releasing its
|
40 |
+
source code to the public.
|
41 |
+
|
42 |
+
The GNU Affero General Public License is designed specifically to
|
43 |
+
ensure that, in such cases, the modified source code becomes available
|
44 |
+
to the community. It requires the operator of a network server to
|
45 |
+
provide the source code of the modified version running there to the
|
46 |
+
users of that server. Therefore, public use of a modified version, on
|
47 |
+
a publicly accessible server, gives the public access to the source
|
48 |
+
code of the modified version.
|
49 |
+
|
50 |
+
An older license, called the Affero General Public License and
|
51 |
+
published by Affero, was designed to accomplish similar goals. This is
|
52 |
+
a different license, not a version of the Affero GPL, but Affero has
|
53 |
+
released a new version of the Affero GPL which permits relicensing under
|
54 |
+
this license.
|
55 |
+
|
56 |
+
The precise terms and conditions for copying, distribution and
|
57 |
+
modification follow.
|
58 |
+
|
59 |
+
TERMS AND CONDITIONS
|
60 |
+
|
61 |
+
0. Definitions.
|
62 |
+
|
63 |
+
"This License" refers to version 3 of the GNU Affero General Public License.
|
64 |
+
|
65 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
66 |
+
works, such as semiconductor masks.
|
67 |
+
|
68 |
+
"The Program" refers to any copyrightable work licensed under this
|
69 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
70 |
+
"recipients" may be individuals or organizations.
|
71 |
+
|
72 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
73 |
+
in a fashion requiring copyright permission, other than the making of an
|
74 |
+
exact copy. The resulting work is called a "modified version" of the
|
75 |
+
earlier work or a work "based on" the earlier work.
|
76 |
+
|
77 |
+
A "covered work" means either the unmodified Program or a work based
|
78 |
+
on the Program.
|
79 |
+
|
80 |
+
To "propagate" a work means to do anything with it that, without
|
81 |
+
permission, would make you directly or secondarily liable for
|
82 |
+
infringement under applicable copyright law, except executing it on a
|
83 |
+
computer or modifying a private copy. Propagation includes copying,
|
84 |
+
distribution (with or without modification), making available to the
|
85 |
+
public, and in some countries other activities as well.
|
86 |
+
|
87 |
+
To "convey" a work means any kind of propagation that enables other
|
88 |
+
parties to make or receive copies. Mere interaction with a user through
|
89 |
+
a computer network, with no transfer of a copy, is not conveying.
|
90 |
+
|
91 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
92 |
+
to the extent that it includes a convenient and prominently visible
|
93 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
94 |
+
tells the user that there is no warranty for the work (except to the
|
95 |
+
extent that warranties are provided), that licensees may convey the
|
96 |
+
work under this License, and how to view a copy of this License. If
|
97 |
+
the interface presents a list of user commands or options, such as a
|
98 |
+
menu, a prominent item in the list meets this criterion.
|
99 |
+
|
100 |
+
1. Source Code.
|
101 |
+
|
102 |
+
The "source code" for a work means the preferred form of the work
|
103 |
+
for making modifications to it. "Object code" means any non-source
|
104 |
+
form of a work.
|
105 |
+
|
106 |
+
A "Standard Interface" means an interface that either is an official
|
107 |
+
standard defined by a recognized standards body, or, in the case of
|
108 |
+
interfaces specified for a particular programming language, one that
|
109 |
+
is widely used among developers working in that language.
|
110 |
+
|
111 |
+
The "System Libraries" of an executable work include anything, other
|
112 |
+
than the work as a whole, that (a) is included in the normal form of
|
113 |
+
packaging a Major Component, but which is not part of that Major
|
114 |
+
Component, and (b) serves only to enable use of the work with that
|
115 |
+
Major Component, or to implement a Standard Interface for which an
|
116 |
+
implementation is available to the public in source code form. A
|
117 |
+
"Major Component", in this context, means a major essential component
|
118 |
+
(kernel, window system, and so on) of the specific operating system
|
119 |
+
(if any) on which the executable work runs, or a compiler used to
|
120 |
+
produce the work, or an object code interpreter used to run it.
|
121 |
+
|
122 |
+
The "Corresponding Source" for a work in object code form means all
|
123 |
+
the source code needed to generate, install, and (for an executable
|
124 |
+
work) run the object code and to modify the work, including scripts to
|
125 |
+
control those activities. However, it does not include the work's
|
126 |
+
System Libraries, or general-purpose tools or generally available free
|
127 |
+
programs which are used unmodified in performing those activities but
|
128 |
+
which are not part of the work. For example, Corresponding Source
|
129 |
+
includes interface definition files associated with source files for
|
130 |
+
the work, and the source code for shared libraries and dynamically
|
131 |
+
linked subprograms that the work is specifically designed to require,
|
132 |
+
such as by intimate data communication or control flow between those
|
133 |
+
subprograms and other parts of the work.
|
134 |
+
|
135 |
+
The Corresponding Source need not include anything that users
|
136 |
+
can regenerate automatically from other parts of the Corresponding
|
137 |
+
Source.
|
138 |
+
|
139 |
+
The Corresponding Source for a work in source code form is that
|
140 |
+
same work.
|
141 |
+
|
142 |
+
2. Basic Permissions.
|
143 |
+
|
144 |
+
All rights granted under this License are granted for the term of
|
145 |
+
copyright on the Program, and are irrevocable provided the stated
|
146 |
+
conditions are met. This License explicitly affirms your unlimited
|
147 |
+
permission to run the unmodified Program. The output from running a
|
148 |
+
covered work is covered by this License only if the output, given its
|
149 |
+
content, constitutes a covered work. This License acknowledges your
|
150 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
151 |
+
|
152 |
+
You may make, run and propagate covered works that you do not
|
153 |
+
convey, without conditions so long as your license otherwise remains
|
154 |
+
in force. You may convey covered works to others for the sole purpose
|
155 |
+
of having them make modifications exclusively for you, or provide you
|
156 |
+
with facilities for running those works, provided that you comply with
|
157 |
+
the terms of this License in conveying all material for which you do
|
158 |
+
not control copyright. Those thus making or running the covered works
|
159 |
+
for you must do so exclusively on your behalf, under your direction
|
160 |
+
and control, on terms that prohibit them from making any copies of
|
161 |
+
your copyrighted material outside their relationship with you.
|
162 |
+
|
163 |
+
Conveying under any other circumstances is permitted solely under
|
164 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
165 |
+
makes it unnecessary.
|
166 |
+
|
167 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
168 |
+
|
169 |
+
No covered work shall be deemed part of an effective technological
|
170 |
+
measure under any applicable law fulfilling obligations under article
|
171 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
172 |
+
similar laws prohibiting or restricting circumvention of such
|
173 |
+
measures.
|
174 |
+
|
175 |
+
When you convey a covered work, you waive any legal power to forbid
|
176 |
+
circumvention of technological measures to the extent such circumvention
|
177 |
+
is effected by exercising rights under this License with respect to
|
178 |
+
the covered work, and you disclaim any intention to limit operation or
|
179 |
+
modification of the work as a means of enforcing, against the work's
|
180 |
+
users, your or third parties' legal rights to forbid circumvention of
|
181 |
+
technological measures.
|
182 |
+
|
183 |
+
4. Conveying Verbatim Copies.
|
184 |
+
|
185 |
+
You may convey verbatim copies of the Program's source code as you
|
186 |
+
receive it, in any medium, provided that you conspicuously and
|
187 |
+
appropriately publish on each copy an appropriate copyright notice;
|
188 |
+
keep intact all notices stating that this License and any
|
189 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
190 |
+
keep intact all notices of the absence of any warranty; and give all
|
191 |
+
recipients a copy of this License along with the Program.
|
192 |
+
|
193 |
+
You may charge any price or no price for each copy that you convey,
|
194 |
+
and you may offer support or warranty protection for a fee.
|
195 |
+
|
196 |
+
5. Conveying Modified Source Versions.
|
197 |
+
|
198 |
+
You may convey a work based on the Program, or the modifications to
|
199 |
+
produce it from the Program, in the form of source code under the
|
200 |
+
terms of section 4, provided that you also meet all of these conditions:
|
201 |
+
|
202 |
+
a) The work must carry prominent notices stating that you modified
|
203 |
+
it, and giving a relevant date.
|
204 |
+
|
205 |
+
b) The work must carry prominent notices stating that it is
|
206 |
+
released under this License and any conditions added under section
|
207 |
+
7. This requirement modifies the requirement in section 4 to
|
208 |
+
"keep intact all notices".
|
209 |
+
|
210 |
+
c) You must license the entire work, as a whole, under this
|
211 |
+
License to anyone who comes into possession of a copy. This
|
212 |
+
License will therefore apply, along with any applicable section 7
|
213 |
+
additional terms, to the whole of the work, and all its parts,
|
214 |
+
regardless of how they are packaged. This License gives no
|
215 |
+
permission to license the work in any other way, but it does not
|
216 |
+
invalidate such permission if you have separately received it.
|
217 |
+
|
218 |
+
d) If the work has interactive user interfaces, each must display
|
219 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
220 |
+
interfaces that do not display Appropriate Legal Notices, your
|
221 |
+
work need not make them do so.
|
222 |
+
|
223 |
+
A compilation of a covered work with other separate and independent
|
224 |
+
works, which are not by their nature extensions of the covered work,
|
225 |
+
and which are not combined with it such as to form a larger program,
|
226 |
+
in or on a volume of a storage or distribution medium, is called an
|
227 |
+
"aggregate" if the compilation and its resulting copyright are not
|
228 |
+
used to limit the access or legal rights of the compilation's users
|
229 |
+
beyond what the individual works permit. Inclusion of a covered work
|
230 |
+
in an aggregate does not cause this License to apply to the other
|
231 |
+
parts of the aggregate.
|
232 |
+
|
233 |
+
6. Conveying Non-Source Forms.
|
234 |
+
|
235 |
+
You may convey a covered work in object code form under the terms
|
236 |
+
of sections 4 and 5, provided that you also convey the
|
237 |
+
machine-readable Corresponding Source under the terms of this License,
|
238 |
+
in one of these ways:
|
239 |
+
|
240 |
+
a) Convey the object code in, or embodied in, a physical product
|
241 |
+
(including a physical distribution medium), accompanied by the
|
242 |
+
Corresponding Source fixed on a durable physical medium
|
243 |
+
customarily used for software interchange.
|
244 |
+
|
245 |
+
b) Convey the object code in, or embodied in, a physical product
|
246 |
+
(including a physical distribution medium), accompanied by a
|
247 |
+
written offer, valid for at least three years and valid for as
|
248 |
+
long as you offer spare parts or customer support for that product
|
249 |
+
model, to give anyone who possesses the object code either (1) a
|
250 |
+
copy of the Corresponding Source for all the software in the
|
251 |
+
product that is covered by this License, on a durable physical
|
252 |
+
medium customarily used for software interchange, for a price no
|
253 |
+
more than your reasonable cost of physically performing this
|
254 |
+
conveying of source, or (2) access to copy the
|
255 |
+
Corresponding Source from a network server at no charge.
|
256 |
+
|
257 |
+
c) Convey individual copies of the object code with a copy of the
|
258 |
+
written offer to provide the Corresponding Source. This
|
259 |
+
alternative is allowed only occasionally and noncommercially, and
|
260 |
+
only if you received the object code with such an offer, in accord
|
261 |
+
with subsection 6b.
|
262 |
+
|
263 |
+
d) Convey the object code by offering access from a designated
|
264 |
+
place (gratis or for a charge), and offer equivalent access to the
|
265 |
+
Corresponding Source in the same way through the same place at no
|
266 |
+
further charge. You need not require recipients to copy the
|
267 |
+
Corresponding Source along with the object code. If the place to
|
268 |
+
copy the object code is a network server, the Corresponding Source
|
269 |
+
may be on a different server (operated by you or a third party)
|
270 |
+
that supports equivalent copying facilities, provided you maintain
|
271 |
+
clear directions next to the object code saying where to find the
|
272 |
+
Corresponding Source. Regardless of what server hosts the
|
273 |
+
Corresponding Source, you remain obligated to ensure that it is
|
274 |
+
available for as long as needed to satisfy these requirements.
|
275 |
+
|
276 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
277 |
+
you inform other peers where the object code and Corresponding
|
278 |
+
Source of the work are being offered to the general public at no
|
279 |
+
charge under subsection 6d.
|
280 |
+
|
281 |
+
A separable portion of the object code, whose source code is excluded
|
282 |
+
from the Corresponding Source as a System Library, need not be
|
283 |
+
included in conveying the object code work.
|
284 |
+
|
285 |
+
A "User Product" is either (1) a "consumer product", which means any
|
286 |
+
tangible personal property which is normally used for personal, family,
|
287 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
288 |
+
into a dwelling. In determining whether a product is a consumer product,
|
289 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
290 |
+
product received by a particular user, "normally used" refers to a
|
291 |
+
typical or common use of that class of product, regardless of the status
|
292 |
+
of the particular user or of the way in which the particular user
|
293 |
+
actually uses, or expects or is expected to use, the product. A product
|
294 |
+
is a consumer product regardless of whether the product has substantial
|
295 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
296 |
+
the only significant mode of use of the product.
|
297 |
+
|
298 |
+
"Installation Information" for a User Product means any methods,
|
299 |
+
procedures, authorization keys, or other information required to install
|
300 |
+
and execute modified versions of a covered work in that User Product from
|
301 |
+
a modified version of its Corresponding Source. The information must
|
302 |
+
suffice to ensure that the continued functioning of the modified object
|
303 |
+
code is in no case prevented or interfered with solely because
|
304 |
+
modification has been made.
|
305 |
+
|
306 |
+
If you convey an object code work under this section in, or with, or
|
307 |
+
specifically for use in, a User Product, and the conveying occurs as
|
308 |
+
part of a transaction in which the right of possession and use of the
|
309 |
+
User Product is transferred to the recipient in perpetuity or for a
|
310 |
+
fixed term (regardless of how the transaction is characterized), the
|
311 |
+
Corresponding Source conveyed under this section must be accompanied
|
312 |
+
by the Installation Information. But this requirement does not apply
|
313 |
+
if neither you nor any third party retains the ability to install
|
314 |
+
modified object code on the User Product (for example, the work has
|
315 |
+
been installed in ROM).
|
316 |
+
|
317 |
+
The requirement to provide Installation Information does not include a
|
318 |
+
requirement to continue to provide support service, warranty, or updates
|
319 |
+
for a work that has been modified or installed by the recipient, or for
|
320 |
+
the User Product in which it has been modified or installed. Access to a
|
321 |
+
network may be denied when the modification itself materially and
|
322 |
+
adversely affects the operation of the network or violates the rules and
|
323 |
+
protocols for communication across the network.
|
324 |
+
|
325 |
+
Corresponding Source conveyed, and Installation Information provided,
|
326 |
+
in accord with this section must be in a format that is publicly
|
327 |
+
documented (and with an implementation available to the public in
|
328 |
+
source code form), and must require no special password or key for
|
329 |
+
unpacking, reading or copying.
|
330 |
+
|
331 |
+
7. Additional Terms.
|
332 |
+
|
333 |
+
"Additional permissions" are terms that supplement the terms of this
|
334 |
+
License by making exceptions from one or more of its conditions.
|
335 |
+
Additional permissions that are applicable to the entire Program shall
|
336 |
+
be treated as though they were included in this License, to the extent
|
337 |
+
that they are valid under applicable law. If additional permissions
|
338 |
+
apply only to part of the Program, that part may be used separately
|
339 |
+
under those permissions, but the entire Program remains governed by
|
340 |
+
this License without regard to the additional permissions.
|
341 |
+
|
342 |
+
When you convey a copy of a covered work, you may at your option
|
343 |
+
remove any additional permissions from that copy, or from any part of
|
344 |
+
it. (Additional permissions may be written to require their own
|
345 |
+
removal in certain cases when you modify the work.) You may place
|
346 |
+
additional permissions on material, added by you to a covered work,
|
347 |
+
for which you have or can give appropriate copyright permission.
|
348 |
+
|
349 |
+
Notwithstanding any other provision of this License, for material you
|
350 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
351 |
+
that material) supplement the terms of this License with terms:
|
352 |
+
|
353 |
+
a) Disclaiming warranty or limiting liability differently from the
|
354 |
+
terms of sections 15 and 16 of this License; or
|
355 |
+
|
356 |
+
b) Requiring preservation of specified reasonable legal notices or
|
357 |
+
author attributions in that material or in the Appropriate Legal
|
358 |
+
Notices displayed by works containing it; or
|
359 |
+
|
360 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
361 |
+
requiring that modified versions of such material be marked in
|
362 |
+
reasonable ways as different from the original version; or
|
363 |
+
|
364 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
365 |
+
authors of the material; or
|
366 |
+
|
367 |
+
e) Declining to grant rights under trademark law for use of some
|
368 |
+
trade names, trademarks, or service marks; or
|
369 |
+
|
370 |
+
f) Requiring indemnification of licensors and authors of that
|
371 |
+
material by anyone who conveys the material (or modified versions of
|
372 |
+
it) with contractual assumptions of liability to the recipient, for
|
373 |
+
any liability that these contractual assumptions directly impose on
|
374 |
+
those licensors and authors.
|
375 |
+
|
376 |
+
All other non-permissive additional terms are considered "further
|
377 |
+
restrictions" within the meaning of section 10. If the Program as you
|
378 |
+
received it, or any part of it, contains a notice stating that it is
|
379 |
+
governed by this License along with a term that is a further
|
380 |
+
restriction, you may remove that term. If a license document contains
|
381 |
+
a further restriction but permits relicensing or conveying under this
|
382 |
+
License, you may add to a covered work material governed by the terms
|
383 |
+
of that license document, provided that the further restriction does
|
384 |
+
not survive such relicensing or conveying.
|
385 |
+
|
386 |
+
If you add terms to a covered work in accord with this section, you
|
387 |
+
must place, in the relevant source files, a statement of the
|
388 |
+
additional terms that apply to those files, or a notice indicating
|
389 |
+
where to find the applicable terms.
|
390 |
+
|
391 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
392 |
+
form of a separately written license, or stated as exceptions;
|
393 |
+
the above requirements apply either way.
|
394 |
+
|
395 |
+
8. Termination.
|
396 |
+
|
397 |
+
You may not propagate or modify a covered work except as expressly
|
398 |
+
provided under this License. Any attempt otherwise to propagate or
|
399 |
+
modify it is void, and will automatically terminate your rights under
|
400 |
+
this License (including any patent licenses granted under the third
|
401 |
+
paragraph of section 11).
|
402 |
+
|
403 |
+
However, if you cease all violation of this License, then your
|
404 |
+
license from a particular copyright holder is reinstated (a)
|
405 |
+
provisionally, unless and until the copyright holder explicitly and
|
406 |
+
finally terminates your license, and (b) permanently, if the copyright
|
407 |
+
holder fails to notify you of the violation by some reasonable means
|
408 |
+
prior to 60 days after the cessation.
|
409 |
+
|
410 |
+
Moreover, your license from a particular copyright holder is
|
411 |
+
reinstated permanently if the copyright holder notifies you of the
|
412 |
+
violation by some reasonable means, this is the first time you have
|
413 |
+
received notice of violation of this License (for any work) from that
|
414 |
+
copyright holder, and you cure the violation prior to 30 days after
|
415 |
+
your receipt of the notice.
|
416 |
+
|
417 |
+
Termination of your rights under this section does not terminate the
|
418 |
+
licenses of parties who have received copies or rights from you under
|
419 |
+
this License. If your rights have been terminated and not permanently
|
420 |
+
reinstated, you do not qualify to receive new licenses for the same
|
421 |
+
material under section 10.
|
422 |
+
|
423 |
+
9. Acceptance Not Required for Having Copies.
|
424 |
+
|
425 |
+
You are not required to accept this License in order to receive or
|
426 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
427 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
428 |
+
to receive a copy likewise does not require acceptance. However,
|
429 |
+
nothing other than this License grants you permission to propagate or
|
430 |
+
modify any covered work. These actions infringe copyright if you do
|
431 |
+
not accept this License. Therefore, by modifying or propagating a
|
432 |
+
covered work, you indicate your acceptance of this License to do so.
|
433 |
+
|
434 |
+
10. Automatic Licensing of Downstream Recipients.
|
435 |
+
|
436 |
+
Each time you convey a covered work, the recipient automatically
|
437 |
+
receives a license from the original licensors, to run, modify and
|
438 |
+
propagate that work, subject to this License. You are not responsible
|
439 |
+
for enforcing compliance by third parties with this License.
|
440 |
+
|
441 |
+
An "entity transaction" is a transaction transferring control of an
|
442 |
+
organization, or substantially all assets of one, or subdividing an
|
443 |
+
organization, or merging organizations. If propagation of a covered
|
444 |
+
work results from an entity transaction, each party to that
|
445 |
+
transaction who receives a copy of the work also receives whatever
|
446 |
+
licenses to the work the party's predecessor in interest had or could
|
447 |
+
give under the previous paragraph, plus a right to possession of the
|
448 |
+
Corresponding Source of the work from the predecessor in interest, if
|
449 |
+
the predecessor has it or can get it with reasonable efforts.
|
450 |
+
|
451 |
+
You may not impose any further restrictions on the exercise of the
|
452 |
+
rights granted or affirmed under this License. For example, you may
|
453 |
+
not impose a license fee, royalty, or other charge for exercise of
|
454 |
+
rights granted under this License, and you may not initiate litigation
|
455 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
456 |
+
any patent claim is infringed by making, using, selling, offering for
|
457 |
+
sale, or importing the Program or any portion of it.
|
458 |
+
|
459 |
+
11. Patents.
|
460 |
+
|
461 |
+
A "contributor" is a copyright holder who authorizes use under this
|
462 |
+
License of the Program or a work on which the Program is based. The
|
463 |
+
work thus licensed is called the contributor's "contributor version".
|
464 |
+
|
465 |
+
A contributor's "essential patent claims" are all patent claims
|
466 |
+
owned or controlled by the contributor, whether already acquired or
|
467 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
468 |
+
by this License, of making, using, or selling its contributor version,
|
469 |
+
but do not include claims that would be infringed only as a
|
470 |
+
consequence of further modification of the contributor version. For
|
471 |
+
purposes of this definition, "control" includes the right to grant
|
472 |
+
patent sublicenses in a manner consistent with the requirements of
|
473 |
+
this License.
|
474 |
+
|
475 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
476 |
+
patent license under the contributor's essential patent claims, to
|
477 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
478 |
+
propagate the contents of its contributor version.
|
479 |
+
|
480 |
+
In the following three paragraphs, a "patent license" is any express
|
481 |
+
agreement or commitment, however denominated, not to enforce a patent
|
482 |
+
(such as an express permission to practice a patent or covenant not to
|
483 |
+
sue for patent infringement). To "grant" such a patent license to a
|
484 |
+
party means to make such an agreement or commitment not to enforce a
|
485 |
+
patent against the party.
|
486 |
+
|
487 |
+
If you convey a covered work, knowingly relying on a patent license,
|
488 |
+
and the Corresponding Source of the work is not available for anyone
|
489 |
+
to copy, free of charge and under the terms of this License, through a
|
490 |
+
publicly available network server or other readily accessible means,
|
491 |
+
then you must either (1) cause the Corresponding Source to be so
|
492 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
493 |
+
patent license for this particular work, or (3) arrange, in a manner
|
494 |
+
consistent with the requirements of this License, to extend the patent
|
495 |
+
license to downstream recipients. "Knowingly relying" means you have
|
496 |
+
actual knowledge that, but for the patent license, your conveying the
|
497 |
+
covered work in a country, or your recipient's use of the covered work
|
498 |
+
in a country, would infringe one or more identifiable patents in that
|
499 |
+
country that you have reason to believe are valid.
|
500 |
+
|
501 |
+
If, pursuant to or in connection with a single transaction or
|
502 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
503 |
+
covered work, and grant a patent license to some of the parties
|
504 |
+
receiving the covered work authorizing them to use, propagate, modify
|
505 |
+
or convey a specific copy of the covered work, then the patent license
|
506 |
+
you grant is automatically extended to all recipients of the covered
|
507 |
+
work and works based on it.
|
508 |
+
|
509 |
+
A patent license is "discriminatory" if it does not include within
|
510 |
+
the scope of its coverage, prohibits the exercise of, or is
|
511 |
+
conditioned on the non-exercise of one or more of the rights that are
|
512 |
+
specifically granted under this License. You may not convey a covered
|
513 |
+
work if you are a party to an arrangement with a third party that is
|
514 |
+
in the business of distributing software, under which you make payment
|
515 |
+
to the third party based on the extent of your activity of conveying
|
516 |
+
the work, and under which the third party grants, to any of the
|
517 |
+
parties who would receive the covered work from you, a discriminatory
|
518 |
+
patent license (a) in connection with copies of the covered work
|
519 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
520 |
+
for and in connection with specific products or compilations that
|
521 |
+
contain the covered work, unless you entered into that arrangement,
|
522 |
+
or that patent license was granted, prior to 28 March 2007.
|
523 |
+
|
524 |
+
Nothing in this License shall be construed as excluding or limiting
|
525 |
+
any implied license or other defenses to infringement that may
|
526 |
+
otherwise be available to you under applicable patent law.
|
527 |
+
|
528 |
+
12. No Surrender of Others' Freedom.
|
529 |
+
|
530 |
+
If conditions are imposed on you (whether by court order, agreement or
|
531 |
+
otherwise) that contradict the conditions of this License, they do not
|
532 |
+
excuse you from the conditions of this License. If you cannot convey a
|
533 |
+
covered work so as to satisfy simultaneously your obligations under this
|
534 |
+
License and any other pertinent obligations, then as a consequence you may
|
535 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
536 |
+
to collect a royalty for further conveying from those to whom you convey
|
537 |
+
the Program, the only way you could satisfy both those terms and this
|
538 |
+
License would be to refrain entirely from conveying the Program.
|
539 |
+
|
540 |
+
13. Remote Network Interaction; Use with the GNU General Public License.
|
541 |
+
|
542 |
+
Notwithstanding any other provision of this License, if you modify the
|
543 |
+
Program, your modified version must prominently offer all users
|
544 |
+
interacting with it remotely through a computer network (if your version
|
545 |
+
supports such interaction) an opportunity to receive the Corresponding
|
546 |
+
Source of your version by providing access to the Corresponding Source
|
547 |
+
from a network server at no charge, through some standard or customary
|
548 |
+
means of facilitating copying of software. This Corresponding Source
|
549 |
+
shall include the Corresponding Source for any work covered by version 3
|
550 |
+
of the GNU General Public License that is incorporated pursuant to the
|
551 |
+
following paragraph.
|
552 |
+
|
553 |
+
Notwithstanding any other provision of this License, you have
|
554 |
+
permission to link or combine any covered work with a work licensed
|
555 |
+
under version 3 of the GNU General Public License into a single
|
556 |
+
combined work, and to convey the resulting work. The terms of this
|
557 |
+
License will continue to apply to the part which is the covered work,
|
558 |
+
but the work with which it is combined will remain governed by version
|
559 |
+
3 of the GNU General Public License.
|
560 |
+
|
561 |
+
14. Revised Versions of this License.
|
562 |
+
|
563 |
+
The Free Software Foundation may publish revised and/or new versions of
|
564 |
+
the GNU Affero General Public License from time to time. Such new versions
|
565 |
+
will be similar in spirit to the present version, but may differ in detail to
|
566 |
+
address new problems or concerns.
|
567 |
+
|
568 |
+
Each version is given a distinguishing version number. If the
|
569 |
+
Program specifies that a certain numbered version of the GNU Affero General
|
570 |
+
Public License "or any later version" applies to it, you have the
|
571 |
+
option of following the terms and conditions either of that numbered
|
572 |
+
version or of any later version published by the Free Software
|
573 |
+
Foundation. If the Program does not specify a version number of the
|
574 |
+
GNU Affero General Public License, you may choose any version ever published
|
575 |
+
by the Free Software Foundation.
|
576 |
+
|
577 |
+
If the Program specifies that a proxy can decide which future
|
578 |
+
versions of the GNU Affero General Public License can be used, that proxy's
|
579 |
+
public statement of acceptance of a version permanently authorizes you
|
580 |
+
to choose that version for the Program.
|
581 |
+
|
582 |
+
Later license versions may give you additional or different
|
583 |
+
permissions. However, no additional obligations are imposed on any
|
584 |
+
author or copyright holder as a result of your choosing to follow a
|
585 |
+
later version.
|
586 |
+
|
587 |
+
15. Disclaimer of Warranty.
|
588 |
+
|
589 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
590 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
591 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
592 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
593 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
594 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
595 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
596 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
597 |
+
|
598 |
+
16. Limitation of Liability.
|
599 |
+
|
600 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
601 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
602 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
603 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
604 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
605 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
606 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
607 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
608 |
+
SUCH DAMAGES.
|
609 |
+
|
610 |
+
17. Interpretation of Sections 15 and 16.
|
611 |
+
|
612 |
+
If the disclaimer of warranty and limitation of liability provided
|
613 |
+
above cannot be given local legal effect according to their terms,
|
614 |
+
reviewing courts shall apply local law that most closely approximates
|
615 |
+
an absolute waiver of all civil liability in connection with the
|
616 |
+
Program, unless a warranty or assumption of liability accompanies a
|
617 |
+
copy of the Program in return for a fee.
|
618 |
+
|
619 |
+
END OF TERMS AND CONDITIONS
|
620 |
+
|
621 |
+
How to Apply These Terms to Your New Programs
|
622 |
+
|
623 |
+
If you develop a new program, and you want it to be of the greatest
|
624 |
+
possible use to the public, the best way to achieve this is to make it
|
625 |
+
free software which everyone can redistribute and change under these terms.
|
626 |
+
|
627 |
+
To do so, attach the following notices to the program. It is safest
|
628 |
+
to attach them to the start of each source file to most effectively
|
629 |
+
state the exclusion of warranty; and each file should have at least
|
630 |
+
the "copyright" line and a pointer to where the full notice is found.
|
631 |
+
|
632 |
+
<one line to give the program's name and a brief idea of what it does.>
|
633 |
+
Copyright (C) <year> <name of author>
|
634 |
+
|
635 |
+
This program is free software: you can redistribute it and/or modify
|
636 |
+
it under the terms of the GNU Affero General Public License as published
|
637 |
+
by the Free Software Foundation, either version 3 of the License, or
|
638 |
+
(at your option) any later version.
|
639 |
+
|
640 |
+
This program is distributed in the hope that it will be useful,
|
641 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
642 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
643 |
+
GNU Affero General Public License for more details.
|
644 |
+
|
645 |
+
You should have received a copy of the GNU Affero General Public License
|
646 |
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
647 |
+
|
648 |
+
Also add information on how to contact you by electronic and paper mail.
|
649 |
+
|
650 |
+
If your software can interact with users remotely through a computer
|
651 |
+
network, you should also make sure that it provides a way for users to
|
652 |
+
get its source. For example, if your program is a web application, its
|
653 |
+
interface could display a "Source" link that leads users to an archive
|
654 |
+
of the code. There are many ways you could offer source, and different
|
655 |
+
solutions will be better for different programs; see section 13 for the
|
656 |
+
specific requirements.
|
657 |
+
|
658 |
+
You should also get your employer (if you work as a programmer) or school,
|
659 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
660 |
+
For more information on this, and how to apply and follow the GNU AGPL, see
|
661 |
+
<https://www.gnu.org/licenses/>.
|
LICENSE-MoeGoe
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2022 CjangCjengh
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
Model/Bishojo_Mangekyo/config_mangekyo.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"segment_size": 8192
|
4 |
+
},
|
5 |
+
"data": {
|
6 |
+
"text_cleaners":["japanese_cleaners"],
|
7 |
+
"max_wav_value": 32768.0,
|
8 |
+
"sampling_rate": 22050,
|
9 |
+
"filter_length": 1024,
|
10 |
+
"hop_length": 256,
|
11 |
+
"win_length": 1024,
|
12 |
+
"add_blank": true,
|
13 |
+
"n_speakers": 6
|
14 |
+
},
|
15 |
+
"model": {
|
16 |
+
"inter_channels": 192,
|
17 |
+
"hidden_channels": 192,
|
18 |
+
"filter_channels": 768,
|
19 |
+
"n_heads": 2,
|
20 |
+
"n_layers": 6,
|
21 |
+
"kernel_size": 3,
|
22 |
+
"p_dropout": 0.1,
|
23 |
+
"resblock": "1",
|
24 |
+
"resblock_kernel_sizes": [3,7,11],
|
25 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
26 |
+
"upsample_rates": [8,8,2,2],
|
27 |
+
"upsample_initial_channel": 512,
|
28 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
29 |
+
"n_layers_q": 3,
|
30 |
+
"use_spectral_norm": false,
|
31 |
+
"gin_channels": 256
|
32 |
+
},
|
33 |
+
"speakers": ["\u84ee\u83ef", "\u7bdd\u30ce\u9727\u679d", "\u6ca2\u6e21\u96eb", "\u4e9c\u7483\u5b50", "\u706f\u9732\u690e", "\u89a1\u5915\u8389"],
|
34 |
+
"symbols": ["_", ",", ".", "!", "?", "-", "~","A", "E", "I", "N", "O", "Q", "U", "a", "b", "d", "e", "f", "g", "h", "i", "j", "k", "m", "n", "o", "p", "r", "s", "t", "u", "v", "w", "y", "z", "\u0283", "\u02a7", "\u2193", "\u2191", " "]
|
35 |
+
}
|
36 |
+
|
Model/Bishojo_Mangekyo/generator_mangekyo.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0acae1546bdda967fff35eba4e001c9d4d854d57c83678eb1575160a91a9b6fd
|
3 |
+
size 158893717
|
Model/Cantonese/config.json
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"segment_size": 8192
|
4 |
+
},
|
5 |
+
"data": {
|
6 |
+
"text_cleaners":["chinese_dialect_cleaners"],
|
7 |
+
"max_wav_value": 32768.0,
|
8 |
+
"sampling_rate": 22050,
|
9 |
+
"filter_length": 1024,
|
10 |
+
"hop_length": 256,
|
11 |
+
"win_length": 1024,
|
12 |
+
"add_blank": true,
|
13 |
+
"n_speakers": 50
|
14 |
+
},
|
15 |
+
"model": {
|
16 |
+
"inter_channels": 192,
|
17 |
+
"hidden_channels": 192,
|
18 |
+
"filter_channels": 768,
|
19 |
+
"n_heads": 2,
|
20 |
+
"n_layers": 6,
|
21 |
+
"kernel_size": 3,
|
22 |
+
"p_dropout": 0.1,
|
23 |
+
"resblock": "1",
|
24 |
+
"resblock_kernel_sizes": [3,7,11],
|
25 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
26 |
+
"upsample_rates": [8,8,2,2],
|
27 |
+
"upsample_initial_channel": 512,
|
28 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
29 |
+
"n_layers_q": 3,
|
30 |
+
"use_spectral_norm": false,
|
31 |
+
"gin_channels": 256
|
32 |
+
},
|
33 |
+
"speakers": ["\u5e03\u826f\u6893(cantonese)", "\u7dbe\u5730\u5be7\u3005(cantonese)", "\u671d\u6b66\u82b3\u4e43(cantonese)", "\u5728\u539f\u4e03\u6d77(cantonese)", "\u30e6\u30fc\u30b9\u30c6\u30a3\u30a2(cantonese)", "\u30b3\u30ec\u30c3\u30c8(cantonese)", "\u30ea\u30b7\u30a2(cantonese)", "\u30ab\u30a4\u30e0(cantonese)", "\u30eb\u30a4\u30ba(cantonese)", "\u3064\u304f\u3088\u307f\u3061\u3083\u3093(cantonese)", "\u83f2\u5442\u83c8(cantonese)", "\u8b1d\u5b50\u81e3(cantonese)", "\u96ea\u898b(cantonese)", "\u590f\u828a\u5e06(cantonese)", "\u7f85\u5c11\u5cf0(cantonese)", "\u8b1d\u5b50\u7487(cantonese)", "\u6960\u5e0c\u59d0(cantonese)", "\u8389\u8389(cantonese)", "\u5c0f\u8338(cantonese)", "\u5510\u4e50\u541f(cantonese)", "\u5c0f\u6bb7(cantonese)", "\u82b1\u73b2(cantonese)", "\u6d77\u8bcd\u4e0a\u6d77\u8bdd(cantonese)", "\u6d77\u8bcd\u5e7f\u4e1c\u8bdd(cantonese)"],
|
34 |
+
"symbols": ["_", ",", ".", "!", "?", "~", "\u2026", "\u2500", "#", "N", "a", "b", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "v", "w", "x", "y", "z", "\u00e6", "\u00e7", "\u00f8", "\u014b", "\u0153", "\u0235", "\u0250", "\u0251", "\u0252", "\u0253", "\u0254", "\u0255", "\u0257", "\u0258", "\u0259", "\u025a", "\u025b", "\u025c", "\u0263", "\u0264", "\u0266", "\u026a", "\u026d", "\u026f", "\u0275", "\u0277", "\u0278", "\u027b", "\u027e", "\u027f", "\u0282", "\u0285", "\u028a", "\u028b", "\u028c", "\u028f", "\u0291", "\u0294", "\u02a6", "\u02ae", "\u02b0", "\u02b7", "\u02c0", "\u02d0", "\u02e5", "\u02e6", "\u02e7", "\u02e8", "\u02e9", "\u0303", "\u031a", "\u0325", "\u0329", "\u1d00", "\u1d07", "\u2191", "\u2193", "\u2205", "\u2c7c", " "]
|
35 |
+
}
|
Model/Cantonese/model.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5bafc0ad64442808ccbdc1c880846d4d7ed30e5db6b9c68982bade0070e135a9
|
3 |
+
size 158966349
|
Model/Nene_Nanami_Rong_Tang/1374_epochs.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:edfb6b428c398fab83a85b5ae41e13cb5a9f7be12692129e8a880d4553701f7b
|
3 |
+
size 158888013
|
Model/Nene_Nanami_Rong_Tang/config.json
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"segment_size": 8192
|
4 |
+
},
|
5 |
+
"data": {
|
6 |
+
"text_cleaners":["zh_ja_mixture_cleaners"],
|
7 |
+
"max_wav_value": 32768.0,
|
8 |
+
"sampling_rate": 22050,
|
9 |
+
"filter_length": 1024,
|
10 |
+
"hop_length": 256,
|
11 |
+
"win_length": 1024,
|
12 |
+
"add_blank": true,
|
13 |
+
"n_speakers": 5
|
14 |
+
},
|
15 |
+
"model": {
|
16 |
+
"inter_channels": 192,
|
17 |
+
"hidden_channels": 192,
|
18 |
+
"filter_channels": 768,
|
19 |
+
"n_heads": 2,
|
20 |
+
"n_layers": 6,
|
21 |
+
"kernel_size": 3,
|
22 |
+
"p_dropout": 0.1,
|
23 |
+
"resblock": "1",
|
24 |
+
"resblock_kernel_sizes": [3,7,11],
|
25 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
26 |
+
"upsample_rates": [8,8,2,2],
|
27 |
+
"upsample_initial_channel": 512,
|
28 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
29 |
+
"n_layers_q": 3,
|
30 |
+
"use_spectral_norm": false,
|
31 |
+
"gin_channels": 256
|
32 |
+
},
|
33 |
+
"speakers": ["\u7dbe\u5730\u5be7\u3005", "\u5728\u539f\u4e03\u6d77", "\u5c0f\u8338", "\u5510\u4e50\u541f"],
|
34 |
+
"symbols": ["_", ",", ".", "!", "?", "-", "~", "\u2026", "A", "E", "I", "N", "O", "Q", "U", "a", "b", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "v", "w", "y", "z", "\u0283", "\u02a7", "\u02a6", "\u026f", "\u0279", "\u0259", "\u0265", "\u207c", "\u02b0", "`", "\u2192", "\u2193", "\u2191", " "]
|
35 |
+
}
|
Model/genshin/G_953000.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:03017f9a30580eb9103bc892a98299ed702f114d821146aa4b550e5ca724923e
|
3 |
+
size 159716737
|
Model/genshin/config.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"log_interval": 200,
|
4 |
+
"eval_interval": 1000,
|
5 |
+
"seed": 1234,
|
6 |
+
"epochs": 10000,
|
7 |
+
"learning_rate": 2e-4,
|
8 |
+
"betas": [0.8, 0.99],
|
9 |
+
"eps": 1e-9,
|
10 |
+
"batch_size": 64,
|
11 |
+
"fp16_run": true,
|
12 |
+
"lr_decay": 0.999875,
|
13 |
+
"segment_size": 8192,
|
14 |
+
"init_lr_ratio": 1,
|
15 |
+
"warmup_epochs": 0,
|
16 |
+
"c_mel": 45,
|
17 |
+
"c_kl": 1.0
|
18 |
+
},
|
19 |
+
"data": {
|
20 |
+
"training_files":"filelists/uma_genshin_genshinjp_bh3_train.txt.cleaned",
|
21 |
+
"validation_files":"filelists/uma_genshin_genshinjp_bh3_val.txt.cleaned",
|
22 |
+
"text_cleaners":["zh_ja_mixture_cleaners"],
|
23 |
+
"max_wav_value": 32768.0,
|
24 |
+
"sampling_rate": 22050,
|
25 |
+
"filter_length": 1024,
|
26 |
+
"hop_length": 256,
|
27 |
+
"win_length": 1024,
|
28 |
+
"n_mel_channels": 80,
|
29 |
+
"mel_fmin": 0.0,
|
30 |
+
"mel_fmax": null,
|
31 |
+
"add_blank": true,
|
32 |
+
"n_speakers": 804,
|
33 |
+
"cleaned_text": true
|
34 |
+
},
|
35 |
+
"model": {
|
36 |
+
"inter_channels": 192,
|
37 |
+
"hidden_channels": 192,
|
38 |
+
"filter_channels": 768,
|
39 |
+
"n_heads": 2,
|
40 |
+
"n_layers": 6,
|
41 |
+
"kernel_size": 3,
|
42 |
+
"p_dropout": 0.1,
|
43 |
+
"resblock": "1",
|
44 |
+
"resblock_kernel_sizes": [3,7,11],
|
45 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
46 |
+
"upsample_rates": [8,8,2,2],
|
47 |
+
"upsample_initial_channel": 512,
|
48 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
49 |
+
"n_layers_q": 3,
|
50 |
+
"use_spectral_norm": false,
|
51 |
+
"gin_channels": 256
|
52 |
+
},
|
53 |
+
"speakers": ["\u7279\u522b\u5468", "\u65e0\u58f0\u94c3\u9e7f", "\u4e1c\u6d77\u5e1d\u7687\uff08\u5e1d\u5b9d\uff0c\u5e1d\u738b\uff09", "\u4e38\u5584\u65af\u57fa", "\u5bcc\u58eb\u5947\u8ff9", "\u5c0f\u6817\u5e3d", "\u9ec4\u91d1\u8239", "\u4f0f\u7279\u52a0", "\u5927\u548c\u8d64\u9aa5", "\u5927\u6811\u5feb\u8f66", "\u8349\u4e0a\u98de", "\u83f1\u4e9a\u9a6c\u900a", "\u76ee\u767d\u9ea6\u6606", "\u795e\u9e70", "\u597d\u6b4c\u5267", "\u6210\u7530\u767d\u4ec1", "\u9c81\u9053\u592b\u8c61\u5f81\uff08\u7687\u5e1d\uff09", "\u6c14\u69fd", "\u7231\u4e3d\u6570\u7801", "\u661f\u4e91\u5929\u7a7a", "\u7389\u85fb\u5341\u5b57", "\u7f8e\u5999\u59ff\u52bf", "\u7435\u7436\u6668\u5149", "\u6469\u8036\u91cd\u70ae", "\u66fc\u57ce\u8336\u5ea7", "\u7f8e\u6d66\u6ce2\u65c1", "\u76ee\u767d\u8d56\u6069", "\u83f1\u66d9", "\u96ea\u4e2d\u7f8e\u4eba", "\u7c73\u6d74", "\u827e\u5c3c\u65af\u98ce\u795e", "\u7231\u4e3d\u901f\u5b50\uff08\u7231\u4e3d\u5feb\u5b50\uff09", "\u7231\u6155\u7ec7\u59ec", "\u7a3b\u8377\u4e00", "\u80dc\u5229\u5956\u5238", "\u7a7a\u4e2d\u795e\u5bab", "\u8363\u8fdb\u95ea\u8000", "\u771f\u673a\u4f36", "\u5ddd\u4e0a\u516c\u4e3b", "\u9ec4\u91d1\u57ce\uff08\u9ec4\u91d1\u57ce\u5e02\uff09", "\u6a31\u82b1\u8fdb\u738b", "\u91c7\u73e0", "\u65b0\u5149\u98ce", "\u4e1c\u5546\u53d8\u9769", "\u8d85\u7ea7\u5c0f\u6d77\u6e7e", "\u9192\u76ee\u98de\u9e70\uff08\u5bc4\u5bc4\u5b50\uff09", "\u8352\u6f20\u82f1\u96c4", "\u4e1c\u701b\u4f50\u6566", "\u4e2d\u5c71\u5e86\u5178", "\u6210\u7530\u5927\u8fdb", "\u897f\u91ce\u82b1", "\u6625\u4e3d\uff08\u4e4c\u62c9\u62c9\uff09", "\u9752\u7af9\u56de\u5fc6", "\u5fae\u5149\u98de\u9a79", "\u7f8e\u4e3d\u5468\u65e5", "\u5f85\u517c\u798f\u6765", "mr cb\uff08cb\u5148\u751f\uff09", "\u540d\u5c06\u6012\u6d9b\uff08\u540d\u5c06\u6237\u4ec1\uff09", "\u76ee\u767d\u591a\u4f2f", "\u4f18\u79c0\u7d20\u8d28", "\u5e1d\u738b\u5149\u8f89", "\u5f85\u517c\u8bd7\u6b4c\u5267", "\u751f\u91ce\u72c4\u675c\u65af", "\u76ee\u767d\u5584\u4fe1", "\u5927\u62d3\u592a\u9633\u795e", "\u53cc\u6da1\u8f6e\uff08\u4e24\u7acb\u76f4\uff0c\u4e24\u55b7\u5c04\uff0c\u4e8c\u9505\u5934\uff0c\u9006\u55b7\u5c04\uff09", "\u91cc\u89c1\u5149\u94bb\uff08\u8428\u6258\u8bfa\u91d1\u521a\u77f3\uff09", "\u5317\u90e8\u7384\u9a79", "\u6a31\u82b1\u5343\u4ee3\u738b", "\u5929\u72fc\u661f\u8c61\u5f81", "\u76ee\u767d\u963f\u5c14\u4e39", "\u516b\u91cd\u65e0\u654c", "\u9e64\u4e38\u521a\u5fd7", "\u76ee\u767d\u5149\u660e", "\u6210\u7530\u62dc\u4ec1\uff08\u6210\u7530\u8def\uff09", "\u4e5f\u6587\u6444\u8f89", "\u5c0f\u6797\u5386\u5947", "\u5317\u6e2f\u706b\u5c71", "\u5947\u9510\u9a8f", "\u82e6\u6da9\u7cd6\u971c", "\u5c0f\u5c0f\u8695\u8327", "\u9a8f\u5ddd\u624b\u7eb2\uff08\u7eff\u5e3d\u6076\u9b54\uff09", "\u79cb\u5ddd\u5f25\u751f\uff08\u5c0f\u5c0f\u7406\u4e8b\u957f\uff09", "\u4e59\u540d\u53f2\u60a6\u5b50\uff08\u4e59\u540d\u8bb0\u8005\uff09", "\u6850\u751f\u9662\u8475", "\u5b89\u5fc3\u6cfd\u523a\u523a\u7f8e", "\u6a2b\u672c\u7406\u5b50", "\u795e\u91cc\u7eeb\u534e\uff08\u9f9f\u9f9f\uff09", "\u7434", "\u7a7a\uff08\u7a7a\u54e5\uff09", "\u4e3d\u838e", "\u8367\uff08\u8367\u59b9\uff09", "\u82ad\u82ad\u62c9", "\u51ef\u4e9a", "\u8fea\u5362\u514b", "\u96f7\u6cfd", "\u5b89\u67cf", "\u6e29\u8fea", "\u9999\u83f1", "\u5317\u6597", "\u884c\u79cb", "\u9b48", "\u51dd\u5149", "\u53ef\u8389", "\u949f\u79bb", "\u83f2\u8c22\u5c14\uff08\u7687\u5973\uff09", "\u73ed\u5c3c\u7279", "\u8fbe\u8fbe\u5229\u4e9a\uff08\u516c\u5b50\uff09", "\u8bfa\u827e\u5c14\uff08\u5973\u4ec6\uff09", "\u4e03\u4e03", "\u91cd\u4e91", "\u7518\u96e8\uff08\u6930\u7f8a\uff09", "\u963f\u8d1d\u591a", "\u8fea\u5965\u5a1c\uff08\u732b\u732b\uff09", "\u83ab\u5a1c", "\u523b\u6674", "\u7802\u7cd6", "\u8f9b\u7131", "\u7f57\u838e\u8389\u4e9a", "\u80e1\u6843", "\u67ab\u539f\u4e07\u53f6\uff08\u4e07\u53f6\uff09", "\u70df\u7eef", "\u5bb5\u5bab", "\u6258\u9a6c", "\u4f18\u83c8", "\u96f7\u7535\u5c06\u519b\uff08\u96f7\u795e\uff09", "\u65e9\u67da", "\u73ca\u745a\u5bab\u5fc3\u6d77\uff08\u5fc3\u6d77\uff0c\u6263\u6263\u7c73\uff09", "\u4e94\u90ce", "\u4e5d\u6761\u88df\u7f57", "\u8352\u6cf7\u4e00\u6597\uff08\u4e00\u6597\uff09", "\u57c3\u6d1b\u4f0a", "\u7533\u9e64", "\u516b\u91cd\u795e\u5b50\uff08\u795e\u5b50\uff09", "\u795e\u91cc\u7eeb\u4eba\uff08\u7eeb\u4eba\uff09", "\u591c\u5170", "\u4e45\u5c90\u5fcd", "\u9e7f\u91ce\u82d1\u5e73\u85cf", "\u63d0\u7eb3\u91cc", "\u67ef\u83b1", "\u591a\u8389", "\u4e91\u5807", "\u7eb3\u897f\u59b2\uff08\u8349\u795e\uff09", "\u6df1\u6e0a\u4f7f\u5f92", "\u59ae\u9732", "\u8d5b\u8bfa", "\u503a\u52a1\u5904\u7406\u4eba", "\u574e\u8482\u4e1d", "\u771f\u5f13\u5feb\u8f66", "\u79cb\u4eba", "\u671b\u65cf", "\u827e\u5c14\u83f2", "\u827e\u8389\u4e1d", "\u827e\u4f26", "\u963f\u6d1b\u74e6", "\u5929\u91ce", "\u5929\u76ee\u5341\u4e94", "\u611a\u4eba\u4f17-\u5b89\u5fb7\u70c8", "\u5b89\u987a", "\u5b89\u897f", "\u8475", "\u9752\u6728", "\u8352\u5ddd\u5e78\u6b21", "\u8352\u8c37", "\u6709\u6cfd", "\u6d45\u5ddd", "\u9ebb\u7f8e", "\u51dd\u5149\u52a9\u624b", "\u963f\u6258", "\u7afa\u5b50", "\u767e\u8bc6", "\u767e\u95fb", "\u767e\u6653", "\u767d\u672f", "\u8d1d\u96c5\u7279\u4e3d\u5947", "\u4e3d\u5854", "\u5931\u843d\u8ff7\u8fed", "\u7f2d\u4e71\u661f\u68d8", "\u4f0a\u7538", "\u4f0f\u7279\u52a0\u5973\u5b69", "\u72c2\u70ed\u84dd\u8c03", "\u8389\u8389\u5a05", "\u841d\u838e\u8389\u5a05", "\u516b\u91cd\u6a31", "\u516b\u91cd\u971e", "\u5361\u83b2", "\u7b2c\u516d\u591c\u60f3\u66f2", "\u5361\u841d\u5c14", "\u59ec\u5b50", "\u6781\u5730\u6218\u5203", "\u5e03\u6d1b\u59ae\u5a05", "\u6b21\u751f\u94f6\u7ffc", "\u7406\u4e4b\u5f8b\u8005%26\u5e0c\u513f", "\u7406\u4e4b\u5f8b\u8005", "\u8ff7\u57ce\u9a87\u5154", "\u5e0c\u513f", "\u9b47\u591c\u661f\u6e0a", "\u9ed1\u5e0c\u513f", "\u5e15\u6735\u83f2\u8389\u4e1d", "\u4e0d\u706d\u661f\u951a", "\u5929\u5143\u9a91\u82f1", "\u5e7d\u5170\u9edb\u5c14", "\u6d3e\u8499bh3", "\u7231\u9171", "\u7eef\u7389\u4e38", "\u5fb7\u4e3d\u838e", "\u6708\u4e0b\u521d\u62e5", "\u6714\u591c\u89c2\u661f", "\u66ae\u5149\u9a91\u58eb", "\u683c\u857e\u4fee", "\u7559\u4e91\u501f\u98ce\u771f\u541b", "\u6885\u6bd4\u4e4c\u65af", "\u4eff\u72b9\u5927", "\u514b\u83b1\u56e0", "\u5723\u5251\u5e7d\u5170\u9edb\u5c14", "\u5996\u7cbe\u7231\u8389", "\u7279\u65af\u62c9zero", "\u82cd\u7384", "\u82e5\u6c34", "\u897f\u7433", "\u6234\u56e0\u65af\u96f7\u5e03", "\u8d1d\u62c9", "\u8d64\u9e22", "\u9547\u9b42\u6b4c", "\u6e21\u9e26", "\u4eba\u4e4b\u5f8b\u8005", "\u7231\u8389\u5e0c\u96c5", "\u5929\u7a79\u6e38\u4fa0", "\u742a\u4e9a\u5a1c", "\u7a7a\u4e4b\u5f8b\u8005", "\u85aa\u708e\u4e4b\u5f8b\u8005", "\u4e91\u58a8\u4e39\u5fc3", "\u7b26\u534e", "\u8bc6\u4e4b\u5f8b\u8005", "\u7279\u74e6\u6797", "\u7ef4\u5c14\u8587", "\u82bd\u8863", "\u96f7\u4e4b\u5f8b\u8005", "\u65ad\u7f6a\u5f71\u821e", "\u963f\u6ce2\u5c3c\u4e9a", "\u698e\u672c", "\u5384\u5c3c\u65af\u7279", "\u6076\u9f99", "\u8303\u4e8c\u7237", "\u6cd5\u62c9", "\u611a\u4eba\u4f17\u58eb\u5175", "\u611a\u4eba\u4f17\u58eb\u5175a", "\u611a\u4eba\u4f17\u58eb\u5175b", "\u611a\u4eba\u4f17\u58eb\u5175c", "\u611a\u4eba\u4f17a", "\u611a\u4eba\u4f17b", "\u98de\u98de", "\u83f2\u5229\u514b\u65af", "\u5973\u6027\u8ddf\u968f\u8005", "\u9022\u5ca9", "\u6446\u6e21\u4eba", "\u72c2\u8e81\u7684\u7537\u4eba", "\u5965\u5179", "\u8299\u841d\u62c9", "\u8ddf\u968f\u8005", "\u871c\u6c41\u751f\u7269", "\u9ec4\u9ebb\u5b50", "\u6e0a\u4e0a", "\u85e4\u6728", "\u6df1\u89c1", "\u798f\u672c", "\u8299\u84c9", "\u53e4\u6cfd", "\u53e4\u7530", "\u53e4\u5c71", "\u53e4\u8c37\u6607", "\u5085\u4e09\u513f", "\u9ad8\u8001\u516d", "\u77ff\u5de5\u5192", "\u5143\u592a", "\u5fb7\u5b89\u516c", "\u8302\u624d\u516c", "\u6770\u62c9\u5fb7", "\u845b\u7f57\u4e3d", "\u91d1\u5ffd\u5f8b", "\u516c\u4fca", "\u9505\u5df4", "\u6b4c\u5fb7", "\u963f\u8c6a", "\u72d7\u4e09\u513f", "\u845b\u745e\u4e1d", "\u82e5\u5fc3", "\u963f\u5c71\u5a46", "\u602a\u9e1f", "\u5e7f\u7af9", "\u89c2\u6d77", "\u5173\u5b8f", "\u871c\u6c41\u536b\u5175", "\u5b88\u536b1", "\u50b2\u6162\u7684\u5b88\u536b", "\u5bb3\u6015\u7684\u5b88\u536b", "\u8d35\u5b89", "\u76d6\u4f0a", "\u963f\u521b", "\u54c8\u592b\u4e39", "\u65e5\u8bed\u963f\u8d1d\u591a\uff08\u91ce\u5c9b\u5065\u513f\uff09", "\u65e5\u8bed\u57c3\u6d1b\u4f0a\uff08\u9ad8\u57a3\u5f69\u9633\uff09", "\u65e5\u8bed\u5b89\u67cf\uff08\u77f3\u89c1\u821e\u83dc\u9999\uff09", "\u65e5\u8bed\u795e\u91cc\u7eeb\u534e\uff08\u65e9\u89c1\u6c99\u7ec7\uff09", "\u65e5\u8bed\u795e\u91cc\u7eeb\u4eba\uff08\u77f3\u7530\u5f70\uff09", "\u65e5\u8bed\u767d\u672f\uff08\u6e38\u4f50\u6d69\u4e8c\uff09", "\u65e5\u8bed\u82ad\u82ad\u62c9\uff08\u9b3c\u5934\u660e\u91cc\uff09", "\u65e5\u8bed\u5317\u6597\uff08\u5c0f\u6e05\u6c34\u4e9a\u7f8e\uff09", "\u65e5\u8bed\u73ed\u5c3c\u7279\uff08\u9022\u5742\u826f\u592a\uff09", "\u65e5\u8bed\u574e\u8482\u4e1d\uff08\u67da\u6728\u51c9\u9999\uff09", "\u65e5\u8bed\u91cd\u4e91\uff08\u9f50\u85e4\u58ee\u9a6c\uff09", "\u65e5\u8bed\u67ef\u83b1\uff08\u524d\u5ddd\u51c9\u5b50\uff09", "\u65e5\u8bed\u8d5b\u8bfa\uff08\u5165\u91ce\u81ea\u7531\uff09", "\u65e5\u8bed\u6234\u56e0\u65af\u96f7\u5e03\uff08\u6d25\u7530\u5065\u6b21\u90ce\uff09", "\u65e5\u8bed\u8fea\u5362\u514b\uff08\u5c0f\u91ce\u8d24\u7ae0\uff09", "\u65e5\u8bed\u8fea\u5965\u5a1c\uff08\u4e95\u6cfd\u8bd7\u7ec7\uff09", "\u65e5\u8bed\u591a\u8389\uff08\u91d1\u7530\u670b\u5b50\uff09", "\u65e5\u8bed\u4f18\u83c8\uff08\u4f50\u85e4\u5229\u5948\uff09", "\u65e5\u8bed\u83f2\u8c22\u5c14\uff08\u5185\u7530\u771f\u793c\uff09", "\u65e5\u8bed\u7518\u96e8\uff08\u4e0a\u7530\u4e3d\u5948\uff09", "\u65e5\u8bed\uff08\u7560\u4e2d\u7950\uff09", "\u65e5\u8bed\u9e7f\u91ce\u9662\u5e73\u85cf\uff08\u4e95\u53e3\u7950\u4e00\uff09", "\u65e5\u8bed\u7a7a\uff08\u5800\u6c5f\u77ac\uff09", "\u65e5\u8bed\u8367\uff08\u60a0\u6728\u78a7\uff09", "\u65e5\u8bed\u80e1\u6843\uff08\u9ad8\u6865\u674e\u4f9d\uff09", "\u65e5\u8bed\u4e00\u6597\uff08\u897f\u5ddd\u8d35\u6559\uff09", "\u65e5\u8bed\u51ef\u4e9a\uff08\u9e1f\u6d77\u6d69\u8f85\uff09", "\u65e5\u8bed\u4e07\u53f6\uff08\u5c9b\u5d0e\u4fe1\u957f\uff09", "\u65e5\u8bed\u523b\u6674\uff08\u559c\u591a\u6751\u82f1\u68a8\uff09", "\u65e5\u8bed\u53ef\u8389\uff08\u4e45\u91ce\u7f8e\u54b2\uff09", "\u65e5\u8bed\u5fc3\u6d77\uff08\u4e09\u68ee\u94c3\u5b50\uff09", "\u65e5\u8bed\u4e5d\u6761\u88df\u7f57\uff08\u6fd1\u6237\u9ebb\u6c99\u7f8e\uff09", "\u65e5\u8bed\u4e3d\u838e\uff08\u7530\u4e2d\u7406\u60e0\uff09", "\u65e5\u8bed\u83ab\u5a1c\uff08\u5c0f\u539f\u597d\u7f8e\uff09", "\u65e5\u8bed\u7eb3\u897f\u59b2\uff08\u7530\u6751\u7531\u52a0\u8389\uff09", "\u65e5\u8bed\u59ae\u9732\uff08\u91d1\u5143\u5bff\u5b50\uff09", "\u65e5\u8bed\u51dd\u5149\uff08\u5927\u539f\u6c99\u8036\u9999\uff09", "\u65e5\u8bed\u8bfa\u827e\u5c14\uff08\u9ad8\u5c3e\u594f\u97f3\uff09", "\u65e5\u8bed\u5965\u5179\uff08\u589e\u8c37\u5eb7\u7eaa\uff09", "\u65e5\u8bed\u6d3e\u8499\uff08\u53e4\u8d3a\u8475\uff09", "\u65e5\u8bed\u7434\uff08\u658b\u85e4\u5343\u548c\uff09", "\u65e5\u8bed\u4e03\u4e03\uff08\u7530\u6751\u7531\u52a0\u8389\uff09", "\u65e5\u8bed\u96f7\u7535\u5c06\u519b\uff08\u6cfd\u57ce\u7f8e\u96ea\uff09", "\u65e5\u8bed\u96f7\u6cfd\uff08\u5185\u5c71\u6602\u8f89\uff09", "\u65e5\u8bed\u7f57\u838e\u8389\u4e9a\uff08\u52a0\u9688\u4e9a\u8863\uff09", "\u65e5\u8bed\u65e9\u67da\uff08\u6d32\u5d0e\u7eeb\uff09", "\u65e5\u8bed\u6563\u5175\uff08\u67ff\u539f\u5f7b\u4e5f\uff09", "\u65e5\u8bed\u7533\u9e64\uff08\u5ddd\u6f84\u7eeb\u5b50\uff09", "\u65e5\u8bed\u4e45\u5c90\u5fcd\uff08\u6c34\u6865\u9999\u7ec7\uff09", "\u65e5\u8bed\u5973\u58eb\uff08\u5e84\u5b50\u88d5\u8863\uff09", "\u65e5\u8bed\u7802\u7cd6\uff08\u85e4\u7530\u831c\uff09", "\u65e5\u8bed\u8fbe\u8fbe\u5229\u4e9a\uff08\u6728\u6751\u826f\u5e73\uff09", "\u65e5\u8bed\u6258\u9a6c\uff08\u68ee\u7530\u6210\u4e00\uff09", "\u65e5\u8bed\u63d0\u7eb3\u91cc\uff08\u5c0f\u6797\u6c99\u82d7\uff09", "\u65e5\u8bed\u6e29\u8fea\uff08\u6751\u6fd1\u6b65\uff09", "\u65e5\u8bed\u9999\u83f1\uff08\u5c0f\u6cfd\u4e9a\u674e\uff09", "\u65e5\u8bed\u9b48\uff08\u677e\u5188\u796f\u4e1e\uff09", "\u65e5\u8bed\u884c\u79cb\uff08\u7686\u5ddd\u7eaf\u5b50\uff09", "\u65e5\u8bed\u8f9b\u7131\uff08\u9ad8\u6865\u667a\u79cb\uff09", "\u65e5\u8bed\u516b\u91cd\u795e\u5b50\uff08\u4f50\u4ed3\u7eeb\u97f3\uff09", "\u65e5\u8bed\u70df\u7eef\uff08\u82b1\u5b88\u7531\u7f8e\u91cc\uff09", "\u65e5\u8bed\u591c\u5170\uff08\u8fdc\u85e4\u7eeb\uff09", "\u65e5\u8bed\u5bb5\u5bab\uff08\u690d\u7530\u4f73\u5948\uff09", "\u65e5\u8bed\u4e91\u5807\uff08\u5c0f\u5ca9\u4e95\u5c0f\u9e1f\uff09", "\u65e5\u8bed\u949f\u79bb\uff08\u524d\u91ce\u667a\u662d\uff09", "\u6770\u514b", "\u963f\u5409", "\u6c5f\u821f", "\u9274\u79cb", "\u5609\u4e49", "\u7eaa\u82b3", "\u666f\u6f84", "\u7ecf\u7eb6", "\u666f\u660e", "\u664b\u4f18", "\u963f\u9e20", "\u9152\u5ba2", "\u4e54\u5c14", "\u4e54\u745f\u592b", "\u7ea6\u987f", "\u4e54\u4f0a\u65af", "\u5c45\u5b89", "\u541b\u541b", "\u987a\u5409", "\u7eaf\u4e5f", "\u91cd\u4f50", "\u5927\u5c9b\u7eaf\u5e73", "\u84b2\u6cfd", "\u52d8\u89e3\u7531\u5c0f\u8def\u5065\u4e09\u90ce", "\u67ab", "\u67ab\u539f\u4e49\u5e86", "\u836b\u5c71", "\u7532\u6590\u7530\u9f8d\u99ac", "\u6d77\u6597", "\u60df\u795e\u6674\u4e4b\u4ecb", "\u9e7f\u91ce\u5948\u5948", "\u5361\u7435\u8389\u4e9a", "\u51ef\u745f\u7433", "\u52a0\u85e4\u4fe1\u609f", "\u52a0\u85e4\u6d0b\u5e73", "\u80dc\u5bb6", "\u8305\u847a\u4e00\u5e86", "\u548c\u662d", "\u4e00\u6b63", "\u4e00\u9053", "\u6842\u4e00", "\u5e86\u6b21\u90ce", "\u963f\u8d24", "\u5065\u53f8", "\u5065\u6b21\u90ce", "\u5065\u4e09\u90ce", "\u5929\u7406", "\u6740\u624ba", "\u6740\u624bb", "\u6728\u5357\u674f\u5948", "\u6728\u6751", "\u56fd\u738b", "\u6728\u4e0b", "\u5317\u6751", "\u6e05\u60e0", "\u6e05\u4eba", "\u514b\u5217\u95e8\u7279", "\u9a91\u58eb", "\u5c0f\u6797", "\u5c0f\u6625", "\u5eb7\u62c9\u5fb7", "\u5927\u8089\u4e38", "\u7434\u7f8e", "\u5b8f\u4e00", "\u5eb7\u4ecb", "\u5e78\u5fb7", "\u9ad8\u5584", "\u68a2", "\u514b\u7f57\u7d22", "\u4e45\u4fdd", "\u4e5d\u6761\u9570\u6cbb", "\u4e45\u6728\u7530", "\u6606\u94a7", "\u83ca\u5730\u541b", "\u4e45\u5229\u987b", "\u9ed1\u7530", "\u9ed1\u6cfd\u4eac\u4e4b\u4ecb", "\u54cd\u592a", "\u5c9a\u59d0", "\u5170\u6eaa", "\u6f9c\u9633", "\u52b3\u4f26\u65af", "\u4e50\u660e", "\u83b1\u8bfa", "\u83b2", "\u826f\u5b50", "\u674e\u5f53", "\u674e\u4e01", "\u5c0f\u4e50", "\u7075", "\u5c0f\u73b2", "\u7433\u7405a", "\u7433\u7405b", "\u5c0f\u5f6c", "\u5c0f\u5fb7", "\u5c0f\u697d", "\u5c0f\u9f99", "\u5c0f\u5434", "\u5c0f\u5434\u7684\u8bb0\u5fc6", "\u7406\u6b63", "\u963f\u9f99", "\u5362\u5361", "\u6d1b\u6210", "\u7f57\u5de7", "\u5317\u98ce\u72fc", "\u5362\u6b63", "\u840d\u59e5\u59e5", "\u524d\u7530", "\u771f\u663c", "\u9ebb\u7eaa", "\u771f", "\u611a\u4eba\u4f17-\u9a6c\u514b\u897f\u59c6", "\u5973\u6027a", "\u5973\u6027b", "\u5973\u6027a\u7684\u8ddf\u968f\u8005", "\u963f\u5b88", "\u739b\u683c\u4e3d\u7279", "\u771f\u7406", "\u739b\u4e54\u4e3d", "\u739b\u6587", "\u6b63\u80dc", "\u660c\u4fe1", "\u5c06\u53f8", "\u6b63\u4eba", "\u8def\u7237", "\u8001\u7ae0", "\u677e\u7530", "\u677e\u672c", "\u677e\u6d66", "\u677e\u5742", "\u8001\u5b5f", "\u5b5f\u4e39", "\u5546\u4eba\u968f\u4ece", "\u4f20\u4ee4\u5175", "\u7c73\u6b47\u5c14", "\u5fa1\u8206\u6e90\u4e00\u90ce", "\u5fa1\u8206\u6e90\u6b21\u90ce", "\u5343\u5ca9\u519b\u6559\u5934", "\u5343\u5ca9\u519b\u58eb\u5175", "\u660e\u535a", "\u660e\u4fca", "\u7f8e\u94c3", "\u7f8e\u548c", "\u963f\u5e78", "\u524a\u6708\u7b51\u9633\u771f\u541b", "\u94b1\u773c\u513f", "\u68ee\u5f66", "\u5143\u52a9", "\u7406\u6c34\u53e0\u5c71\u771f\u541b", "\u7406\u6c34\u758a\u5c71\u771f\u541b", "\u6731\u8001\u677f", "\u6728\u6728", "\u6751\u4e0a", "\u6751\u7530", "\u6c38\u91ce", "\u957f\u91ce\u539f\u9f99\u4e4b\u4ecb", "\u957f\u6fd1", "\u4e2d\u91ce\u5fd7\u4e43", "\u83dc\u83dc\u5b50", "\u6960\u6960", "\u6210\u6fd1", "\u963f\u5185", "\u5b81\u7984", "\u725b\u5fd7", "\u4fe1\u535a", "\u4f38\u592b", "\u91ce\u65b9", "\u8bfa\u62c9", "\u7eaa\u9999", "\u8bfa\u66fc", "\u4fee\u5973", "\u7eaf\u6c34\u7cbe\u7075", "\u5c0f\u5ddd", "\u5c0f\u4ed3\u6faa", "\u5188\u6797", "\u5188\u5d0e\u7ed8\u91cc\u9999", "\u5188\u5d0e\u9646\u6597", "\u5965\u62c9\u592b", "\u8001\u79d1", "\u9b3c\u5a46\u5a46", "\u5c0f\u91ce\u5bfa", "\u5927\u6cb3\u539f\u4e94\u53f3\u536b\u95e8", "\u5927\u4e45\u4fdd\u5927\u4ecb", "\u5927\u68ee", "\u5927\u52a9", "\u5965\u7279", "\u6d3e\u8499", "\u6d3e\u84992", "\u75c5\u4ebaa", "\u75c5\u4ebab", "\u5df4\u987f", "\u6d3e\u6069", "\u670b\u4e49", "\u56f4\u89c2\u7fa4\u4f17", "\u56f4\u89c2\u7fa4\u4f17a", "\u56f4\u89c2\u7fa4\u4f17b", "\u56f4\u89c2\u7fa4\u4f17c", "\u56f4\u89c2\u7fa4\u4f17d", "\u56f4\u89c2\u7fa4\u4f17e", "\u94dc\u96c0", "\u963f\u80a5", "\u5174\u53d4", "\u8001\u5468\u53d4", "\u516c\u4e3b", "\u5f7c\u5f97", "\u4e7e\u5b50", "\u828a\u828a", "\u4e7e\u73ae", "\u7eee\u547d", "\u675e\u5e73", "\u79cb\u6708", "\u6606\u6069", "\u96f7\u7535\u5f71", "\u5170\u9053\u5c14", "\u96f7\u8499\u5fb7", "\u5192\u5931\u7684\u5e15\u62c9\u5fb7", "\u4f36\u4e00", "\u73b2\u82b1", "\u963f\u4ec1", "\u5bb6\u81e3\u4eec", "\u68a8\u7ed8", "\u8363\u6c5f", "\u620e\u4e16", "\u6d6a\u4eba", "\u7f57\u4f0a\u65af", "\u5982\u610f", "\u51c9\u5b50", "\u5f69\u9999", "\u9152\u4e95", "\u5742\u672c", "\u6714\u6b21\u90ce", "\u6b66\u58eba", "\u6b66\u58ebb", "\u6b66\u58ebc", "\u6b66\u58ebd", "\u73ca\u745a", "\u4e09\u7530", "\u838e\u62c9", "\u7b39\u91ce", "\u806a\u7f8e", "\u806a", "\u5c0f\u767e\u5408", "\u6563\u5175", "\u5bb3\u6015\u7684\u5c0f\u5218", "\u8212\u4f2f\u7279", "\u8212\u8328", "\u6d77\u9f99", "\u4e16\u5b50", "\u8c22\u5c14\u76d6", "\u5bb6\u4e01", "\u5546\u534e", "\u6c99\u5bc5", "\u963f\u5347", "\u67f4\u7530", "\u963f\u8302", "\u5f0f\u5927\u5c06", "\u6e05\u6c34", "\u5fd7\u6751\u52d8\u5175\u536b", "\u65b0\u4e4b\u4e1e", "\u5fd7\u7ec7", "\u77f3\u5934", "\u8bd7\u7fbd", "\u8bd7\u7b60", "\u77f3\u58ee", "\u7fd4\u592a", "\u6b63\u4e8c", "\u5468\u5e73", "\u8212\u6768", "\u9f50\u683c\u8299\u4e3d\u96c5", "\u5973\u58eb", "\u601d\u52e4", "\u516d\u6307\u4e54\u745f", "\u611a\u4eba\u4f17\u5c0f\u5175d", "\u611a\u4eba\u4f17\u5c0f\u5175a", "\u611a\u4eba\u4f17\u5c0f\u5175b", "\u611a\u4eba\u4f17\u5c0f\u5175c", "\u5434\u8001\u4e94", "\u5434\u8001\u4e8c", "\u6ed1\u5934\u9b3c", "\u8a00\u7b11", "\u5434\u8001\u4e03", "\u58eb\u5175h", "\u58eb\u5175i", "\u58eb\u5175a", "\u58eb\u5175b", "\u58eb\u5175c", "\u58eb\u5175d", "\u58eb\u5175e", "\u58eb\u5175f", "\u58eb\u5175g", "\u594f\u592a", "\u65af\u5766\u5229", "\u6387\u661f\u652b\u8fb0\u5929\u541b", "\u5c0f\u5934", "\u5927\u6b66", "\u9676\u4e49\u9686", "\u6749\u672c", "\u82cf\u897f", "\u5acc\u7591\u4ebaa", "\u5acc\u7591\u4ebab", "\u5acc\u7591\u4ebac", "\u5acc\u7591\u4ebad", "\u65af\u4e07", "\u5251\u5ba2a", "\u5251\u5ba2b", "\u963f\u4e8c", "\u5fe0\u80dc", "\u5fe0\u592b", "\u963f\u656c", "\u5b5d\u5229", "\u9e70\u53f8\u8fdb", "\u9ad8\u5c71", "\u4e5d\u6761\u5b5d\u884c", "\u6bc5", "\u7af9\u5185", "\u62d3\u771f", "\u5353\u4e5f", "\u592a\u90ce\u4e38", "\u6cf0\u52d2", "\u624b\u5c9b", "\u54f2\u5e73", "\u54f2\u592b", "\u6258\u514b", "\u5927boss", "\u963f\u5f3a", "\u6258\u5c14\u5fb7\u62c9", "\u65c1\u89c2\u8005", "\u5929\u6210", "\u963f\u5927", "\u8482\u739b\u4e4c\u65af", "\u63d0\u7c73", "\u6237\u7530", "\u963f\u4e09", "\u4e00\u8d77\u7684\u4eba", "\u5fb7\u7530", "\u5fb7\u957f", "\u667a\u6811", "\u5229\u5f66", "\u80d6\u4e4e\u4e4e\u7684\u65c5\u884c\u8005", "\u85cf\u5b9d\u4ebaa", "\u85cf\u5b9d\u4ebab", "\u85cf\u5b9d\u4ebac", "\u85cf\u5b9d\u4ebad", "\u963f\u7947", "\u6052\u96c4", "\u9732\u5b50", "\u8bdd\u5267\u56e2\u56e2\u957f", "\u5185\u6751", "\u4e0a\u91ce", "\u4e0a\u6749", "\u8001\u6234", "\u8001\u9ad8", "\u8001\u8d3e", "\u8001\u58a8", "\u8001\u5b59", "\u5929\u67a2\u661f", "\u8001\u4e91", "\u6709\u4e50\u658b", "\u4e11\u96c4", "\u4e4c\u7ef4", "\u74e6\u4eac", "\u83f2\u5c14\u6208\u9edb\u7279", "\u7ef4\u591a\u5229\u4e9a", "\u8587\u5c14", "\u74e6\u683c\u7eb3", "\u963f\u5916", "\u4f8d\u5973", "\u74e6\u62c9", "\u671b\u96c5", "\u5b9b\u70df", "\u742c\u7389", "\u6218\u58eba", "\u6218\u58ebb", "\u6e21\u8fba", "\u6e21\u90e8", "\u963f\u4f1f", "\u6587\u749f", "\u6587\u6e0a", "\u97e6\u5c14\u7eb3", "\u738b\u6273\u624b", "\u6b66\u6c9b", "\u6653\u98de", "\u8f9b\u7a0b", "\u661f\u706b", "\u661f\u7a00", "\u8f9b\u79c0", "\u79c0\u534e", "\u963f\u65ed", "\u5f90\u5218\u5e08", "\u77e2\u90e8", "\u516b\u6728", "\u5c71\u4e0a", "\u963f\u9633", "\u989c\u7b11", "\u5eb7\u660e", "\u6cf0\u4e45", "\u5b89\u6b66", "\u77e2\u7530\u5e78\u559c", "\u77e2\u7530\u8f9b\u559c", "\u4e49\u575a", "\u83ba\u513f", "\u76c8\u4e30", "\u5b9c\u5e74", "\u94f6\u674f", "\u9038\u8f69", "\u6a2a\u5c71", "\u6c38\u8d35", "\u6c38\u4e1a", "\u5609\u4e45", "\u5409\u5ddd", "\u4e49\u9ad8", "\u7528\u9ad8", "\u9633\u592a", "\u5143\u84c9", "\u73a5\u8f89", "\u6bd3\u534e", "\u6709\u9999", "\u5e78\u4e5f", "\u7531\u771f", "\u7ed3\u83dc", "\u97f5\u5b81", "\u767e\u5408", "\u767e\u5408\u534e", "\u5c24\u82cf\u6ce2\u592b", "\u88d5\u5b50", "\u60a0\u7b56", "\u60a0\u4e5f", "\u4e8e\u5ae3", "\u67da\u5b50", "\u8001\u90d1", "\u6b63\u8302", "\u5fd7\u6210", "\u82b7\u5de7", "\u77e5\u6613", "\u652f\u652f", "\u5468\u826f", "\u73e0\u51fd", "\u795d\u660e", "\u795d\u6d9b"],
|
54 |
+
"symbols": ["_", ",", ".", "!", "?", "-", "~", "\u2026", "A", "E", "I", "N", "O", "Q", "U", "a", "b", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "v", "w", "y", "z", "\u0283", "\u02a7", "\u02a6", "\u026f", "\u0279", "\u0259", "\u0265", "\u207c", "\u02b0", "`", "\u2192", "\u2193", "\u2191", " "]
|
55 |
+
}
|
Model/hubert-soft-0d54a1f4.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e82e7d079df05fe3aa535f6f7d42d309bdae1d2a53324e2b2386c56721f4f649
|
3 |
+
size 378435957
|
Model/louise/360_epochs.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:20b38cc55191ec02c2809e80d758ff0d56bd44760841704feb9921aa58a4d9de
|
3 |
+
size 203264375
|
Model/louise/config.json
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"segment_size": 8192
|
4 |
+
},
|
5 |
+
"data": {
|
6 |
+
"max_wav_value": 32768.0,
|
7 |
+
"sampling_rate": 22050,
|
8 |
+
"filter_length": 1024,
|
9 |
+
"hop_length": 256,
|
10 |
+
"win_length": 1024,
|
11 |
+
"add_blank": true,
|
12 |
+
"n_speakers": 0
|
13 |
+
},
|
14 |
+
"model": {
|
15 |
+
"inter_channels": 192,
|
16 |
+
"hidden_channels": 256,
|
17 |
+
"filter_channels": 768,
|
18 |
+
"n_heads": 2,
|
19 |
+
"n_layers": 6,
|
20 |
+
"kernel_size": 3,
|
21 |
+
"p_dropout": 0.1,
|
22 |
+
"resblock": "1",
|
23 |
+
"resblock_kernel_sizes": [3,7,11],
|
24 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
25 |
+
"upsample_rates": [8,8,2,2],
|
26 |
+
"upsample_initial_channel": 512,
|
27 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
28 |
+
"n_layers_q": 3,
|
29 |
+
"use_spectral_norm": false
|
30 |
+
},
|
31 |
+
"speakers": ["\u30eb\u30a4\u30ba"]
|
32 |
+
}
|
Model/model.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9b6e449686c0db86f5c607b8c9fa1d87468c27198a1f0a20280c4e258239763d
|
3 |
+
size 661423381
|
Model/model.yaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
$audonnx.core.model.Model==0.3.2:
|
2 |
+
path: model.onnx
|
3 |
+
labels:
|
4 |
+
logits:
|
5 |
+
- arousal
|
6 |
+
- dominance
|
7 |
+
- valence
|
8 |
+
transform: null
|
Model/npy/all_emotions.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:48e81667f1fc4ce2b2eaed80fadd0871e1ddfc8933767915954c39ac854d5724
|
3 |
+
size 22356096
|
Model/paimon/paimon6k.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"log_interval": 200,
|
4 |
+
"eval_interval": 1000,
|
5 |
+
"seed": 1234,
|
6 |
+
"epochs": 40000,
|
7 |
+
"learning_rate": 2e-4,
|
8 |
+
"betas": [0.8, 0.99],
|
9 |
+
"eps": 1e-9,
|
10 |
+
"batch_size": 46,
|
11 |
+
"fp16_run": true,
|
12 |
+
"lr_decay": 0.999875,
|
13 |
+
"segment_size": 8192,
|
14 |
+
"init_lr_ratio": 1,
|
15 |
+
"warmup_epochs": 0,
|
16 |
+
"c_mel": 45,
|
17 |
+
"c_kl": 1.0
|
18 |
+
},
|
19 |
+
"data": {
|
20 |
+
"training_files":"filelists/paimon_6k_train_chs.txt.cleaned",
|
21 |
+
"validation_files":"filelists/paimon_6k_val_chs.txt.cleaned",
|
22 |
+
"text_cleaners":["chinese_cleaners"],
|
23 |
+
"max_wav_value": 32768.0,
|
24 |
+
"sampling_rate": 48000,
|
25 |
+
"filter_length": 1024,
|
26 |
+
"hop_length": 256,
|
27 |
+
"win_length": 1024,
|
28 |
+
"n_mel_channels": 80,
|
29 |
+
"mel_fmin": 0.0,
|
30 |
+
"mel_fmax": null,
|
31 |
+
"add_blank": true,
|
32 |
+
"n_speakers": 0,
|
33 |
+
"cleaned_text": true
|
34 |
+
},
|
35 |
+
"model": {
|
36 |
+
"inter_channels": 192,
|
37 |
+
"hidden_channels": 192,
|
38 |
+
"filter_channels": 768,
|
39 |
+
"n_heads": 2,
|
40 |
+
"n_layers": 6,
|
41 |
+
"kernel_size": 3,
|
42 |
+
"p_dropout": 0.1,
|
43 |
+
"resblock": "1",
|
44 |
+
"resblock_kernel_sizes": [3,7,11],
|
45 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
46 |
+
"upsample_rates": [8,8,2,2],
|
47 |
+
"upsample_initial_channel": 512,
|
48 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
49 |
+
"n_layers_q": 3,
|
50 |
+
"use_spectral_norm": false,
|
51 |
+
"gin_channels": 256
|
52 |
+
},
|
53 |
+
"speakers": ["paimon"],
|
54 |
+
"symbols": ["_", "\uff0c", "\u3002", "\uff01", "\uff1f", "\u2014", "\u2026", "\u300c", "\u300d", "\u3105", "\u3106", "\u3107", "\u3108", "\u3109", "\u310a", "\u310b", "\u310c", "\u310d", "\u310e", "\u310f", "\u3110", "\u3111", "\u3112", "\u3113", "\u3114", "\u3115", "\u3116", "\u3117", "\u3118", "\u3119", "\u311a", "\u311b", "\u311c", "\u311d", "\u311e", "\u311f", "\u3120", "\u3121", "\u3122", "\u3123", "\u3124", "\u3125", "\u3126", "\u3127", "\u3128", "\u3129", "\u02c9", "\u02ca", "\u02c7", "\u02cb", "\u02d9", " "]
|
55 |
+
}
|
Model/paimon/paimon6k_390000.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b282f7fed04b92186ae8ed1956496e4492d1ee07d84870143c6e7fd3b82d5cb6
|
3 |
+
size 449983387
|
Model/shanghainese/2796_epochs.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:750299355c3cd6bec4bca61ac50dbfb4c1e129be9b0806442cee24071bed657b
|
3 |
+
size 158882637
|
Model/shanghainese/config.json
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"segment_size": 8192
|
4 |
+
},
|
5 |
+
"data": {
|
6 |
+
"text_cleaners":["shanghainese_cleaners"],
|
7 |
+
"max_wav_value": 32768.0,
|
8 |
+
"sampling_rate": 22050,
|
9 |
+
"filter_length": 1024,
|
10 |
+
"hop_length": 256,
|
11 |
+
"win_length": 1024,
|
12 |
+
"add_blank": true,
|
13 |
+
"n_speakers": 2
|
14 |
+
},
|
15 |
+
"model": {
|
16 |
+
"inter_channels": 192,
|
17 |
+
"hidden_channels": 192,
|
18 |
+
"filter_channels": 768,
|
19 |
+
"n_heads": 2,
|
20 |
+
"n_layers": 6,
|
21 |
+
"kernel_size": 3,
|
22 |
+
"p_dropout": 0.1,
|
23 |
+
"resblock": "1",
|
24 |
+
"resblock_kernel_sizes": [3,7,11],
|
25 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
26 |
+
"upsample_rates": [8,8,2,2],
|
27 |
+
"upsample_initial_channel": 512,
|
28 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
29 |
+
"n_layers_q": 3,
|
30 |
+
"use_spectral_norm": false,
|
31 |
+
"gin_channels": 256
|
32 |
+
},
|
33 |
+
"speakers": ["\u4e0a\u6d77\u8bdd(shanghainese)"],
|
34 |
+
"symbols": ["_", ",", ".", "!", "?", "\u2026", "a", "b", "d", "f", "g", "h", "i", "k", "l", "m", "n", "o", "p", "s", "t", "u", "v", "y", "z", "\u00f8", "\u014b", "\u0235", "\u0251", "\u0254", "\u0255", "\u0259", "\u0264", "\u0266", "\u026a", "\u027f", "\u0291", "\u0294", "\u02b0", "\u0303", "\u0329", "\u1d00", "\u1d07", "1", "5", "6", "7", "8", " "]
|
35 |
+
}
|
Model/vctk/pretrained_vctk.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ab981615c443d935fc3a89b08137df544a1175bad99bcbbc9f59e7c3d4930043
|
3 |
+
size 159123481
|
Model/vctk/vctk_base.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"log_interval": 200,
|
4 |
+
"eval_interval": 1000,
|
5 |
+
"seed": 1234,
|
6 |
+
"epochs": 10000,
|
7 |
+
"learning_rate": 2e-4,
|
8 |
+
"betas": [0.8, 0.99],
|
9 |
+
"eps": 1e-9,
|
10 |
+
"batch_size": 64,
|
11 |
+
"fp16_run": true,
|
12 |
+
"lr_decay": 0.999875,
|
13 |
+
"segment_size": 8192,
|
14 |
+
"init_lr_ratio": 1,
|
15 |
+
"warmup_epochs": 0,
|
16 |
+
"c_mel": 45,
|
17 |
+
"c_kl": 1.0
|
18 |
+
},
|
19 |
+
"data": {
|
20 |
+
"training_files":"filelists/vctk_audio_sid_text_train_filelist.txt.cleaned",
|
21 |
+
"validation_files":"filelists/vctk_audio_sid_text_val_filelist.txt.cleaned",
|
22 |
+
"text_cleaners":["english_cleaners2"],
|
23 |
+
"max_wav_value": 32768.0,
|
24 |
+
"sampling_rate": 22050,
|
25 |
+
"filter_length": 1024,
|
26 |
+
"hop_length": 256,
|
27 |
+
"win_length": 1024,
|
28 |
+
"n_mel_channels": 80,
|
29 |
+
"mel_fmin": 0.0,
|
30 |
+
"mel_fmax": null,
|
31 |
+
"add_blank": true,
|
32 |
+
"n_speakers": 109,
|
33 |
+
"cleaned_text": true
|
34 |
+
},
|
35 |
+
"model": {
|
36 |
+
"inter_channels": 192,
|
37 |
+
"hidden_channels": 192,
|
38 |
+
"filter_channels": 768,
|
39 |
+
"n_heads": 2,
|
40 |
+
"n_layers": 6,
|
41 |
+
"kernel_size": 3,
|
42 |
+
"p_dropout": 0.1,
|
43 |
+
"resblock": "1",
|
44 |
+
"resblock_kernel_sizes": [3,7,11],
|
45 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
46 |
+
"upsample_rates": [8,8,2,2],
|
47 |
+
"upsample_initial_channel": 512,
|
48 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
49 |
+
"n_layers_q": 3,
|
50 |
+
"use_spectral_norm": false,
|
51 |
+
"gin_channels": 256
|
52 |
+
},
|
53 |
+
"speakers": ["vctk0(english)","vctk1(english)","vctk2(english)","vctk3(english)","vctk4(english)","vctk5(english)","vctk6(english)","vctk7(english)","vctk8(english)","vctk9(english)","vctk10(english)","vctk11(english)","vctk12(english)","vctk13(english)","vctk14(english)","vctk15(english)","vctk16(english)","vctk17(english)","vctk18(english)","vctk19(english)"],
|
54 |
+
"symbols": ["_", ";", ":", ",", ".", "!", "?", "¡", "¿", "—", "…", "\"", "«", "»", "“", "”", " ", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "ɑ", "ɐ", "ɒ", "æ", "ɓ", "ʙ", "β", "ɔ", "ɕ", "ç", "ɗ", "ɖ", "ð", "ʤ", "ə", "ɘ", "ɚ", "ɛ", "ɜ", "ɝ", "ɞ", "ɟ", "ʄ", "ɡ", "ɠ", "ɢ", "ʛ", "ɦ", "ɧ", "ħ", "ɥ", "ʜ", "ɨ", "ɪ", "ʝ", "ɭ", "ɬ", "ɫ", "ɮ", "ʟ", "ɱ", "ɯ", "ɰ", "ŋ", "ɳ", "ɲ", "ɴ", "ø", "ɵ", "ɸ", "θ", "œ", "ɶ", "ʘ", "ɹ", "ɺ", "ɾ", "ɻ", "ʀ", "ʁ", "ɽ", "ʂ", "ʃ", "ʈ", "ʧ", "ʉ", "ʊ", "ʋ", "ⱱ", "ʌ", "ɣ", "ɤ", "ʍ", "χ", "ʎ", "ʏ", "ʑ", "ʐ", "ʒ", "ʔ", "ʡ", "ʕ", "ʢ", "ǀ", "ǁ", "ǂ", "ǃ", "ˈ", "ˌ", "ː", "ˑ", "ʼ", "ʴ", "ʰ", "ʱ", "ʲ", "ʷ", "ˠ", "ˤ", "˞", "↓", "↑", "→", "↗", "↘", "'", "̩", "'", "ᵻ"]
|
55 |
+
}
|
Model/vits_chinese/bert_vits.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"log_interval": 100,
|
4 |
+
"eval_interval": 10000,
|
5 |
+
"seed": 1234,
|
6 |
+
"epochs": 20000,
|
7 |
+
"learning_rate": 1e-4,
|
8 |
+
"betas": [0.8, 0.99],
|
9 |
+
"eps": 1e-9,
|
10 |
+
"batch_size": 8,
|
11 |
+
"fp16_run": false,
|
12 |
+
"lr_decay": 0.999875,
|
13 |
+
"segment_size": 12800,
|
14 |
+
"init_lr_ratio": 1,
|
15 |
+
"warmup_epochs": 0,
|
16 |
+
"c_mel": 45,
|
17 |
+
"c_kl": 1.0
|
18 |
+
},
|
19 |
+
"data": {
|
20 |
+
"training_files":"filelists/train.txt",
|
21 |
+
"validation_files":"filelists/valid.txt",
|
22 |
+
"text_cleaners":["bert_chinese_cleaners"],
|
23 |
+
"max_wav_value": 32768.0,
|
24 |
+
"sampling_rate": 16000,
|
25 |
+
"filter_length": 1024,
|
26 |
+
"hop_length": 256,
|
27 |
+
"win_length": 1024,
|
28 |
+
"n_mel_channels": 80,
|
29 |
+
"mel_fmin": 0.0,
|
30 |
+
"mel_fmax": null,
|
31 |
+
"add_blank": false,
|
32 |
+
"n_speakers": 0
|
33 |
+
},
|
34 |
+
"model": {
|
35 |
+
"inter_channels": 192,
|
36 |
+
"hidden_channels": 192,
|
37 |
+
"filter_channels": 768,
|
38 |
+
"n_heads": 2,
|
39 |
+
"n_layers": 6,
|
40 |
+
"kernel_size": 3,
|
41 |
+
"p_dropout": 0.1,
|
42 |
+
"resblock": "1",
|
43 |
+
"resblock_kernel_sizes": [3,7,11],
|
44 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
45 |
+
"upsample_rates": [8,8,2,2],
|
46 |
+
"upsample_initial_channel": 512,
|
47 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
48 |
+
"n_layers_q": 3,
|
49 |
+
"use_spectral_norm": false,
|
50 |
+
"use_sdp": false,
|
51 |
+
"bert_embedding": true
|
52 |
+
},
|
53 |
+
"speakers": ["bert"],
|
54 |
+
"symbols": ["sil", "eos", "sp", "#0", "#1", "#2", "#3", "^", "b", "c", "ch", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "sh", "t", "x", "z", "zh", "a1", "a2", "a3", "a4", "a5", "ai1", "ai2", "ai3", "ai4", "ai5", "an1", "an2", "an3", "an4", "an5", "ang1", "ang2", "ang3", "ang4", "ang5", "ao1", "ao2", "ao3", "ao4", "ao5", "e1", "e2", "e3", "e4", "e5", "ei1", "ei2", "ei3", "ei4", "ei5", "en1", "en2", "en3", "en4", "en5", "eng1", "eng2", "eng3", "eng4", "eng5", "er1", "er2", "er3", "er4", "er5", "i1", "i2", "i3", "i4", "i5", "ia1", "ia2", "ia3", "ia4", "ia5", "ian1", "ian2", "ian3", "ian4", "ian5", "iang1", "iang2", "iang3", "iang4", "iang5", "iao1", "iao2", "iao3", "iao4", "iao5", "ie1", "ie2", "ie3", "ie4", "ie5", "ii1", "ii2", "ii3", "ii4", "ii5", "iii1", "iii2", "iii3", "iii4", "iii5", "in1", "in2", "in3", "in4", "in5", "ing1", "ing2", "ing3", "ing4", "ing5", "iong1", "iong2", "iong3", "iong4", "iong5", "iou1", "iou2", "iou3", "iou4", "iou5", "o1", "o2", "o3", "o4", "o5", "ong1", "ong2", "ong3", "ong4", "ong5", "ou1", "ou2", "ou3", "ou4", "ou5", "u1", "u2", "u3", "u4", "u5", "ua1", "ua2", "ua3", "ua4", "ua5", "uai1", "uai2", "uai3", "uai4", "uai5", "uan1", "uan2", "uan3", "uan4", "uan5", "uang1", "uang2", "uang3", "uang4", "uang5", "uei1", "uei2", "uei3", "uei4", "uei5", "uen1", "uen2", "uen3", "uen4", "uen5", "ueng1", "ueng2", "ueng3", "ueng4", "ueng5", "uo1", "uo2", "uo3", "uo4", "uo5", "v1", "v2", "v3", "v4", "v5", "van1", "van2", "van3", "van4", "van5", "ve1", "ve2", "ve3", "ve4", "ve5", "vn1", "vn2", "vn3", "vn4", "vn5"]
|
55 |
+
}
|
Model/vits_chinese/vits_bert_model.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:be0dcf53ffcd49d51fd9a710338a9ff7eed60d0c26ccbb03ebd5a9175f20dc39
|
3 |
+
size 141822877
|
Model/w2v2-vits/1026_epochs.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3f61e221e36af355dba89f20f70215d3a93dbe9fd497172ce46c950f757ccce0
|
3 |
+
size 159675849
|
Model/w2v2-vits/config.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"segment_size": 8192
|
4 |
+
},
|
5 |
+
"data": {
|
6 |
+
"text_cleaners":["zh_ja_mixture_cleaners"],
|
7 |
+
"max_wav_value": 32768.0,
|
8 |
+
"sampling_rate": 22050,
|
9 |
+
"filter_length": 1024,
|
10 |
+
"hop_length": 256,
|
11 |
+
"win_length": 1024,
|
12 |
+
"add_blank": true,
|
13 |
+
"n_speakers": 5,
|
14 |
+
"emotion_embedding": true
|
15 |
+
},
|
16 |
+
"model": {
|
17 |
+
"inter_channels": 192,
|
18 |
+
"hidden_channels": 192,
|
19 |
+
"filter_channels": 768,
|
20 |
+
"n_heads": 2,
|
21 |
+
"n_layers": 6,
|
22 |
+
"kernel_size": 3,
|
23 |
+
"p_dropout": 0.1,
|
24 |
+
"resblock": "1",
|
25 |
+
"resblock_kernel_sizes": [3,7,11],
|
26 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
27 |
+
"upsample_rates": [8,8,2,2],
|
28 |
+
"upsample_initial_channel": 512,
|
29 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
30 |
+
"n_layers_q": 3,
|
31 |
+
"use_spectral_norm": false,
|
32 |
+
"gin_channels": 256
|
33 |
+
},
|
34 |
+
"speakers": ["\u7dbe\u5730\u5be7\u3005", "\u5728\u539f\u4e03\u6d77", "\u5c0f\u8338", "\u5510\u4e50\u541f"],
|
35 |
+
"symbols": ["_", ",", ".", "!", "?", "-", "~", "\u2026", "A", "E", "I", "N", "O", "Q", "U", "a", "b", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "v", "w", "y", "z", "\u0283", "\u02a7", "\u02a6", "\u026f", "\u0279", "\u0259", "\u0265", "\u207c", "\u02b0", "`", "\u2192", "\u2193", "\u2191", " "]
|
36 |
+
}
|
README.md
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
title: vits-simple-api
|
4 |
+
sdk: gradio
|
5 |
+
python_version: 3.10.11
|
6 |
+
emoji: 👀
|
7 |
+
app_file: app.py
|
8 |
+
duplicated_from: Artrajz/vits-simple-api
|
9 |
+
---
|
README_zh.md
ADDED
@@ -0,0 +1,618 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="title" align=center>
|
2 |
+
<h1>vits-simple-api</h1>
|
3 |
+
<div>Simply call the vits api</div>
|
4 |
+
<br/>
|
5 |
+
<br/>
|
6 |
+
<p>
|
7 |
+
<img src="https://img.shields.io/github/license/Artrajz/vits-simple-api">
|
8 |
+
<img src="https://img.shields.io/badge/python-3.9%7C3.10-green">
|
9 |
+
<a href="https://hub.docker.com/r/artrajz/vits-simple-api">
|
10 |
+
<img src="https://img.shields.io/docker/pulls/artrajz/vits-simple-api"></a>
|
11 |
+
</p>
|
12 |
+
<a href="https://github.com/Artrajz/vits-simple-api/blob/main/README.md">English</a>|<a href="https://github.com/Artrajz/vits-simple-api/blob/main/README_zh.md">中文文档</a>
|
13 |
+
<br/>
|
14 |
+
</div>
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
# Feature
|
20 |
+
|
21 |
+
- [x] VITS语音合成,语音转换
|
22 |
+
- [x] HuBert-soft VITS模型
|
23 |
+
- [x] W2V2 VITS / emotional-vits维度情感模型
|
24 |
+
- [x] [vits_chinese](https://github.com/PlayVoice/vits_chinese)
|
25 |
+
- [x] [Bert-VITS2](https://github.com/Stardust-minus/Bert-VITS2)
|
26 |
+
- [x] 加载多模型
|
27 |
+
- [x] 自动识别语言并处理,根据模型的cleaner设置语言类型识别的范围,支持自定义语言类型范围
|
28 |
+
- [x] 自定义默认参数
|
29 |
+
- [x] 长文本批处理
|
30 |
+
- [x] GPU加速推理
|
31 |
+
- [x] SSML语音合成标记语言(完善中...)
|
32 |
+
|
33 |
+
|
34 |
+
## demo
|
35 |
+
|
36 |
+
[![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Artrajz/vits-simple-api)
|
37 |
+
|
38 |
+
注意不同的id支持的语言可能有所不同。[speakers](https://artrajz-vits-simple-api.hf.space/voice/speakers)
|
39 |
+
|
40 |
+
|
41 |
+
- `https://artrajz-vits-simple-api.hf.space/voice/vits?text=你好,こんにちは&id=164`
|
42 |
+
- `https://artrajz-vits-simple-api.hf.space/voice/vits?text=我觉得1%2B1≠3&id=164&lang=zh`(get中一些字符需要转义不然会被过滤掉)
|
43 |
+
- `https://artrajz-vits-simple-api.hf.space/voice/vits?text=Difficult the first time, easy the second.&id=4`
|
44 |
+
- 激动:`https://artrajz-vits-simple-api.hf.space/voice/w2v2-vits?text=こんにちは&id=3&emotion=111`
|
45 |
+
- 小声:`https://artrajz-vits-simple-api.hf.space/voice/w2v2-vits?text=こんにちは&id=3&emotion=2077`
|
46 |
+
|
47 |
+
https://user-images.githubusercontent.com/73542220/237995061-c1f25b4e-dd86-438a-9363-4bb1fe65b425.mov
|
48 |
+
|
49 |
+
# 部署
|
50 |
+
|
51 |
+
## Docker部署
|
52 |
+
|
53 |
+
### 镜像拉取脚本
|
54 |
+
|
55 |
+
```
|
56 |
+
bash -c "$(wget -O- https://raw.githubusercontent.com/Artrajz/vits-simple-api/main/vits-simple-api-installer-latest.sh)"
|
57 |
+
```
|
58 |
+
|
59 |
+
- 目前docker镜像支持的平台`linux/amd64,linux/arm64`
|
60 |
+
- 在拉取完成后,需要导入VITS模型才能使用,请根据以下步骤导入模型。
|
61 |
+
|
62 |
+
### 下载VITS模型
|
63 |
+
|
64 |
+
将模型放入`/usr/local/vits-simple-api/Model`
|
65 |
+
|
66 |
+
<details><summary>Folder structure</summary><pre><code>
|
67 |
+
│ hubert-soft-0d54a1f4.pt
|
68 |
+
│ model.onnx
|
69 |
+
│ model.yaml
|
70 |
+
├─g
|
71 |
+
│ config.json
|
72 |
+
│ G_953000.pth
|
73 |
+
│
|
74 |
+
├─louise
|
75 |
+
│ 360_epochs.pth
|
76 |
+
│ config.json
|
77 |
+
│
|
78 |
+
├─Nene_Nanami_Rong_Tang
|
79 |
+
│ 1374_epochs.pth
|
80 |
+
│ config.json
|
81 |
+
│
|
82 |
+
├─Zero_no_tsukaima
|
83 |
+
│ 1158_epochs.pth
|
84 |
+
│ config.json
|
85 |
+
│
|
86 |
+
└─npy
|
87 |
+
25ecb3f6-f968-11ed-b094-e0d4e84af078.npy
|
88 |
+
all_emotions.npy
|
89 |
+
</code></pre></details>
|
90 |
+
|
91 |
+
|
92 |
+
|
93 |
+
### 修改模型路径
|
94 |
+
|
95 |
+
Modify in `/usr/local/vits-simple-api/config.py`
|
96 |
+
|
97 |
+
<details><summary>config.py</summary><pre><code>
|
98 |
+
# 在此填写模型路径
|
99 |
+
MODEL_LIST = [
|
100 |
+
# VITS
|
101 |
+
[ABS_PATH + "/Model/Nene_Nanami_Rong_Tang/1374_epochs.pth", ABS_PATH + "/Model/Nene_Nanami_Rong_Tang/config.json"],
|
102 |
+
[ABS_PATH + "/Model/Zero_no_tsukaima/1158_epochs.pth", ABS_PATH + "/Model/Zero_no_tsukaima/config.json"],
|
103 |
+
[ABS_PATH + "/Model/g/G_953000.pth", ABS_PATH + "/Model/g/config.json"],
|
104 |
+
# HuBert-VITS (Need to configure HUBERT_SOFT_MODEL)
|
105 |
+
[ABS_PATH + "/Model/louise/360_epochs.pth", ABS_PATH + "/Model/louise/config.json"],
|
106 |
+
# W2V2-VITS (Need to configure DIMENSIONAL_EMOTION_NPY)
|
107 |
+
[ABS_PATH + "/Model/w2v2-vits/1026_epochs.pth", ABS_PATH + "/Model/w2v2-vits/config.json"],
|
108 |
+
]
|
109 |
+
# hubert-vits: hubert soft 编码器
|
110 |
+
HUBERT_SOFT_MODEL = ABS_PATH + "/Model/hubert-soft-0d54a1f4.pt"
|
111 |
+
# w2v2-vits: Dimensional emotion npy file
|
112 |
+
# 加载单独的npy: ABS_PATH+"/all_emotions.npy
|
113 |
+
# 加载多个npy: [ABS_PATH + "/emotions1.npy", ABS_PATH + "/emotions2.npy"]
|
114 |
+
# 从文件夹里加载npy: ABS_PATH + "/Model/npy"
|
115 |
+
DIMENSIONAL_EMOTION_NPY = ABS_PATH + "/Model/npy"
|
116 |
+
# w2v2-vits: 需要在同一路径下有model.onnx和model.yaml
|
117 |
+
DIMENSIONAL_EMOTION_MODEL = ABS_PATH + "/Model/model.yaml"
|
118 |
+
</code></pre></details>
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
### 启动
|
123 |
+
|
124 |
+
`docker compose up -d`
|
125 |
+
|
126 |
+
或者重新执行拉取脚本
|
127 |
+
|
128 |
+
### 镜像更新
|
129 |
+
|
130 |
+
重新执行docker镜像拉取脚本即可
|
131 |
+
|
132 |
+
## 虚拟环境部署
|
133 |
+
|
134 |
+
### Clone
|
135 |
+
|
136 |
+
`git clone https://github.com/Artrajz/vits-simple-api.git`
|
137 |
+
|
138 |
+
### 下载python依赖
|
139 |
+
|
140 |
+
推荐使用python的虚拟环境,python版本 >= 3.9
|
141 |
+
|
142 |
+
`pip install -r requirements.txt`
|
143 |
+
|
144 |
+
windows下可能安装不了fasttext,可以用以下命令安装,附[wheels下载地址](https://www.lfd.uci.edu/~gohlke/pythonlibs/#fasttext)
|
145 |
+
|
146 |
+
```
|
147 |
+
#python3.10 win_amd64
|
148 |
+
pip install https://github.com/Artrajz/archived/raw/main/fasttext/fasttext-0.9.2-cp310-cp310-win_amd64.whl
|
149 |
+
#python3.9 win_amd64
|
150 |
+
pip install https://github.com/Artrajz/archived/raw/main/fasttext/fasttext-0.9.2-cp39-cp39-win_amd64.whl
|
151 |
+
```
|
152 |
+
|
153 |
+
### 下载VITS模型
|
154 |
+
|
155 |
+
将模型放入 `/path/to/vits-simple-api/Model`
|
156 |
+
|
157 |
+
<details><summary>文件夹结构</summary><pre><code>
|
158 |
+
├─g
|
159 |
+
│ config.json
|
160 |
+
│ G_953000.pth
|
161 |
+
│
|
162 |
+
├─louise
|
163 |
+
│ 360_epochs.pth
|
164 |
+
│ config.json
|
165 |
+
│ hubert-soft-0d54a1f4.pt
|
166 |
+
│
|
167 |
+
├─Nene_Nanami_Rong_Tang
|
168 |
+
│ 1374_epochs.pth
|
169 |
+
│ config.json
|
170 |
+
│
|
171 |
+
└─Zero_no_tsukaima
|
172 |
+
1158_epochs.pth
|
173 |
+
config.json
|
174 |
+
</code></pre></details>
|
175 |
+
|
176 |
+
### 修改模型路径
|
177 |
+
|
178 |
+
在 `/path/to/vits-simple-api/config.py` 修改
|
179 |
+
|
180 |
+
<details><summary>config.py</summary><pre><code>
|
181 |
+
# 在此填写模型路径
|
182 |
+
MODEL_LIST = [
|
183 |
+
# VITS
|
184 |
+
[ABS_PATH + "/Model/Nene_Nanami_Rong_Tang/1374_epochs.pth", ABS_PATH + "/Model/Nene_Nanami_Rong_Tang/config.json"],
|
185 |
+
[ABS_PATH + "/Model/Zero_no_tsukaima/1158_epochs.pth", ABS_PATH + "/Model/Zero_no_tsukaima/config.json"],
|
186 |
+
[ABS_PATH + "/Model/g/G_953000.pth", ABS_PATH + "/Model/g/config.json"],
|
187 |
+
# HuBert-VITS (Need to configure HUBERT_SOFT_MODEL)
|
188 |
+
[ABS_PATH + "/Model/louise/360_epochs.pth", ABS_PATH + "/Model/louise/config.json"],
|
189 |
+
# W2V2-VITS (Need to configure DIMENSIONAL_EMOTION_NPY)
|
190 |
+
[ABS_PATH + "/Model/w2v2-vits/1026_epochs.pth", ABS_PATH + "/Model/w2v2-vits/config.json"],
|
191 |
+
]
|
192 |
+
# hubert-vits: hubert soft 编码器
|
193 |
+
HUBERT_SOFT_MODEL = ABS_PATH + "/Model/hubert-soft-0d54a1f4.pt"
|
194 |
+
# w2v2-vits: Dimensional emotion npy file
|
195 |
+
# 加载单独的npy: ABS_PATH+"/all_emotions.npy
|
196 |
+
# 加载多个npy: [ABS_PATH + "/emotions1.npy", ABS_PATH + "/emotions2.npy"]
|
197 |
+
# 从文件夹里加载npy: ABS_PATH + "/Model/npy"
|
198 |
+
DIMENSIONAL_EMOTION_NPY = ABS_PATH + "/Model/npy"
|
199 |
+
# w2v2-vits: 需要在同一路径下有model.onnx和model.yaml
|
200 |
+
DIMENSIONAL_EMOTION_MODEL = ABS_PATH + "/Model/model.yaml"
|
201 |
+
</code></pre></details>
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
### 启动
|
206 |
+
|
207 |
+
`python app.py`
|
208 |
+
|
209 |
+
# GPU 加速
|
210 |
+
|
211 |
+
## windows
|
212 |
+
|
213 |
+
### 安装CUDA
|
214 |
+
|
215 |
+
查看显卡最高支持CUDA的版本
|
216 |
+
|
217 |
+
```
|
218 |
+
nvidia-smi
|
219 |
+
```
|
220 |
+
|
221 |
+
以CUDA11.7为例,[官网](https://developer.nvidia.com/cuda-11-7-0-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local)
|
222 |
+
|
223 |
+
### 安装GPU版pytorch
|
224 |
+
|
225 |
+
CUDA11.7对应的pytorch是用这个命令安装
|
226 |
+
|
227 |
+
```
|
228 |
+
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
|
229 |
+
```
|
230 |
+
|
231 |
+
对应版本的命令可以在[官网](https://pytorch.org/get-started/locally/)找到
|
232 |
+
|
233 |
+
## Linux
|
234 |
+
|
235 |
+
安装过程类似,但我没有相应的环境所以没办法测试
|
236 |
+
|
237 |
+
# Openjtalk安装问题
|
238 |
+
|
239 |
+
如果你是arm64架构的平台,由于pypi官网上没有arm64对应的whl,可能安装会出现一些问题,你可以使用我构建的whl来安装
|
240 |
+
|
241 |
+
```
|
242 |
+
pip install openjtalk==0.3.0.dev2 --index-url https://pypi.artrajz.cn/simple
|
243 |
+
```
|
244 |
+
|
245 |
+
或者是自己手动构建一个whl,可以根据[教程](https://artrajz.cn/index.php/archives/167/)来构建
|
246 |
+
|
247 |
+
# API
|
248 |
+
|
249 |
+
## GET
|
250 |
+
|
251 |
+
#### speakers list
|
252 |
+
|
253 |
+
- GET http://127.0.0.1:23456/voice/speakers
|
254 |
+
|
255 |
+
返回id对应角色的映射表
|
256 |
+
|
257 |
+
#### voice vits
|
258 |
+
|
259 |
+
- GET http://127.0.0.1:23456/voice/vits?text=text
|
260 |
+
|
261 |
+
其他参数不指定时均为默认值
|
262 |
+
|
263 |
+
- GET http://127.0.0.1:23456/voice/vits?text=[ZH]text[ZH][JA]text[JA]&lang=mix
|
264 |
+
|
265 |
+
lang=mix时文本要标注
|
266 |
+
|
267 |
+
- GET http://127.0.0.1:23456/voice/vits?text=text&id=142&format=wav&lang=zh&length=1.4
|
268 |
+
|
269 |
+
文本为text,角色id为142,音频格式为wav,文本语言为zh,语音长度为1.4,其余参数默认
|
270 |
+
|
271 |
+
#### check
|
272 |
+
|
273 |
+
- GET http://127.0.0.1:23456/voice/check?id=0&model=vits
|
274 |
+
|
275 |
+
## POST
|
276 |
+
|
277 |
+
- python
|
278 |
+
|
279 |
+
```python
|
280 |
+
import re
|
281 |
+
import requests
|
282 |
+
import os
|
283 |
+
import random
|
284 |
+
import string
|
285 |
+
from requests_toolbelt.multipart.encoder import MultipartEncoder
|
286 |
+
|
287 |
+
abs_path = os.path.dirname(__file__)
|
288 |
+
base = "http://127.0.0.1:23456"
|
289 |
+
|
290 |
+
|
291 |
+
# 映射表
|
292 |
+
def voice_speakers():
|
293 |
+
url = f"{base}/voice/speakers"
|
294 |
+
|
295 |
+
res = requests.post(url=url)
|
296 |
+
json = res.json()
|
297 |
+
for i in json:
|
298 |
+
print(i)
|
299 |
+
for j in json[i]:
|
300 |
+
print(j)
|
301 |
+
return json
|
302 |
+
|
303 |
+
|
304 |
+
# 语音合成 voice vits
|
305 |
+
def voice_vits(text, id=0, format="wav", lang="auto", length=1, noise=0.667, noisew=0.8, max=50):
|
306 |
+
fields = {
|
307 |
+
"text": text,
|
308 |
+
"id": str(id),
|
309 |
+
"format": format,
|
310 |
+
"lang": lang,
|
311 |
+
"length": str(length),
|
312 |
+
"noise": str(noise),
|
313 |
+
"noisew": str(noisew),
|
314 |
+
"max": str(max)
|
315 |
+
}
|
316 |
+
boundary = '----VoiceConversionFormBoundary' + ''.join(random.sample(string.ascii_letters + string.digits, 16))
|
317 |
+
|
318 |
+
m = MultipartEncoder(fields=fields, boundary=boundary)
|
319 |
+
headers = {"Content-Type": m.content_type}
|
320 |
+
url = f"{base}/voice"
|
321 |
+
|
322 |
+
res = requests.post(url=url, data=m, headers=headers)
|
323 |
+
fname = re.findall("filename=(.+)", res.headers["Content-Disposition"])[0]
|
324 |
+
path = f"{abs_path}/{fname}"
|
325 |
+
|
326 |
+
with open(path, "wb") as f:
|
327 |
+
f.write(res.content)
|
328 |
+
print(path)
|
329 |
+
return path
|
330 |
+
|
331 |
+
|
332 |
+
# 语音转换 hubert-vits
|
333 |
+
def voice_hubert_vits(upload_path, id, format="wav", length=1, noise=0.667, noisew=0.8):
|
334 |
+
upload_name = os.path.basename(upload_path)
|
335 |
+
upload_type = f'audio/{upload_name.split(".")[1]}' # wav,ogg
|
336 |
+
|
337 |
+
with open(upload_path, 'rb') as upload_file:
|
338 |
+
fields = {
|
339 |
+
"upload": (upload_name, upload_file, upload_type),
|
340 |
+
"id": str(id),
|
341 |
+
"format": format,
|
342 |
+
"length": str(length),
|
343 |
+
"noise": str(noise),
|
344 |
+
"noisew": str(noisew),
|
345 |
+
}
|
346 |
+
boundary = '----VoiceConversionFormBoundary' + ''.join(random.sample(string.ascii_letters + string.digits, 16))
|
347 |
+
|
348 |
+
m = MultipartEncoder(fields=fields, boundary=boundary)
|
349 |
+
headers = {"Content-Type": m.content_type}
|
350 |
+
url = f"{base}/voice/hubert-vits"
|
351 |
+
|
352 |
+
res = requests.post(url=url, data=m, headers=headers)
|
353 |
+
fname = re.findall("filename=(.+)", res.headers["Content-Disposition"])[0]
|
354 |
+
path = f"{abs_path}/{fname}"
|
355 |
+
|
356 |
+
with open(path, "wb") as f:
|
357 |
+
f.write(res.content)
|
358 |
+
print(path)
|
359 |
+
return path
|
360 |
+
|
361 |
+
|
362 |
+
# 维度情感模型 w2v2-vits
|
363 |
+
def voice_w2v2_vits(text, id=0, format="wav", lang="auto", length=1, noise=0.667, noisew=0.8, max=50, emotion=0):
|
364 |
+
fields = {
|
365 |
+
"text": text,
|
366 |
+
"id": str(id),
|
367 |
+
"format": format,
|
368 |
+
"lang": lang,
|
369 |
+
"length": str(length),
|
370 |
+
"noise": str(noise),
|
371 |
+
"noisew": str(noisew),
|
372 |
+
"max": str(max),
|
373 |
+
"emotion": str(emotion)
|
374 |
+
}
|
375 |
+
boundary = '----VoiceConversionFormBoundary' + ''.join(random.sample(string.ascii_letters + string.digits, 16))
|
376 |
+
|
377 |
+
m = MultipartEncoder(fields=fields, boundary=boundary)
|
378 |
+
headers = {"Content-Type": m.content_type}
|
379 |
+
url = f"{base}/voice/w2v2-vits"
|
380 |
+
|
381 |
+
res = requests.post(url=url, data=m, headers=headers)
|
382 |
+
fname = re.findall("filename=(.+)", res.headers["Content-Disposition"])[0]
|
383 |
+
path = f"{abs_path}/{fname}"
|
384 |
+
|
385 |
+
with open(path, "wb") as f:
|
386 |
+
f.write(res.content)
|
387 |
+
print(path)
|
388 |
+
return path
|
389 |
+
|
390 |
+
|
391 |
+
# 语音转换 同VITS模型内角色之间的音色转换
|
392 |
+
def voice_conversion(upload_path, original_id, target_id):
|
393 |
+
upload_name = os.path.basename(upload_path)
|
394 |
+
upload_type = f'audio/{upload_name.split(".")[1]}' # wav,ogg
|
395 |
+
|
396 |
+
with open(upload_path, 'rb') as upload_file:
|
397 |
+
fields = {
|
398 |
+
"upload": (upload_name, upload_file, upload_type),
|
399 |
+
"original_id": str(original_id),
|
400 |
+
"target_id": str(target_id),
|
401 |
+
}
|
402 |
+
boundary = '----VoiceConversionFormBoundary' + ''.join(random.sample(string.ascii_letters + string.digits, 16))
|
403 |
+
m = MultipartEncoder(fields=fields, boundary=boundary)
|
404 |
+
|
405 |
+
headers = {"Content-Type": m.content_type}
|
406 |
+
url = f"{base}/voice/conversion"
|
407 |
+
|
408 |
+
res = requests.post(url=url, data=m, headers=headers)
|
409 |
+
|
410 |
+
fname = re.findall("filename=(.+)", res.headers["Content-Disposition"])[0]
|
411 |
+
path = f"{abs_path}/{fname}"
|
412 |
+
|
413 |
+
with open(path, "wb") as f:
|
414 |
+
f.write(res.content)
|
415 |
+
print(path)
|
416 |
+
return path
|
417 |
+
|
418 |
+
|
419 |
+
def voice_ssml(ssml):
|
420 |
+
fields = {
|
421 |
+
"ssml": ssml,
|
422 |
+
}
|
423 |
+
boundary = '----VoiceConversionFormBoundary' + ''.join(random.sample(string.ascii_letters + string.digits, 16))
|
424 |
+
|
425 |
+
m = MultipartEncoder(fields=fields, boundary=boundary)
|
426 |
+
headers = {"Content-Type": m.content_type}
|
427 |
+
url = f"{base}/voice/ssml"
|
428 |
+
|
429 |
+
res = requests.post(url=url, data=m, headers=headers)
|
430 |
+
fname = re.findall("filename=(.+)", res.headers["Content-Disposition"])[0]
|
431 |
+
path = f"{abs_path}/{fname}"
|
432 |
+
|
433 |
+
with open(path, "wb") as f:
|
434 |
+
f.write(res.content)
|
435 |
+
print(path)
|
436 |
+
return path
|
437 |
+
|
438 |
+
def voice_dimensional_emotion(upload_path):
|
439 |
+
upload_name = os.path.basename(upload_path)
|
440 |
+
upload_type = f'audio/{upload_name.split(".")[1]}' # wav,ogg
|
441 |
+
|
442 |
+
with open(upload_path, 'rb') as upload_file:
|
443 |
+
fields = {
|
444 |
+
"upload": (upload_name, upload_file, upload_type),
|
445 |
+
}
|
446 |
+
boundary = '----VoiceConversionFormBoundary' + ''.join(random.sample(string.ascii_letters + string.digits, 16))
|
447 |
+
|
448 |
+
m = MultipartEncoder(fields=fields, boundary=boundary)
|
449 |
+
headers = {"Content-Type": m.content_type}
|
450 |
+
url = f"{base}/voice/dimension-emotion"
|
451 |
+
|
452 |
+
res = requests.post(url=url, data=m, headers=headers)
|
453 |
+
fname = re.findall("filename=(.+)", res.headers["Content-Disposition"])[0]
|
454 |
+
path = f"{abs_path}/{fname}"
|
455 |
+
|
456 |
+
with open(path, "wb") as f:
|
457 |
+
f.write(res.content)
|
458 |
+
print(path)
|
459 |
+
return path
|
460 |
+
```
|
461 |
+
|
462 |
+
## API KEY
|
463 |
+
|
464 |
+
在config.py中设置`API_KEY_ENABLED = True`以启用,api key填写:`API_KEY = "api-key"`。
|
465 |
+
|
466 |
+
启用后,GET请求中使用需要增加参数api_key,POST请求中使用需要在header中添加参数`X-API-KEY`。
|
467 |
+
|
468 |
+
# Parameter
|
469 |
+
|
470 |
+
## VITS语音合成
|
471 |
+
|
472 |
+
| Name | Parameter | Is must | Default | Type | Instruction |
|
473 |
+
| ------------- | --------- | ------- | ------------------- | ----- | ------------------------------------------------------------ |
|
474 |
+
| 合成文本 | text | true | | str | 需要合成语音的文本。 |
|
475 |
+
| 角色id | id | false | 从`config.py`中获取 | int | 即说话人id。 |
|
476 |
+
| 音频格式 | format | false | 从`config.py`中获取 | str | 支持wav,ogg,silk,mp3,flac |
|
477 |
+
| 文本语言 | lang | false | 从`config.py`中获取 | str | auto为自动识别语言模式,也是默认模式。lang=mix时,文本应该用[ZH] 或 [JA] 包裹。方言无法自动识别。 |
|
478 |
+
| 语音长度/语速 | length | false | 从`config.py`中获取 | float | 调节语音长度,相当于调节语速,该数值越大语速越慢。 |
|
479 |
+
| 噪声 | noise | false | 从`config.py`中获取 | float | 样本噪声,控制合成的随机性。 |
|
480 |
+
| sdp噪声 | noisew | false | 从`config.py`中获取 | float | 随机时长预测器噪声,控制音素发音长度。 |
|
481 |
+
| 分段阈值 | max | false | 从`config.py`中获取 | int | 按标点符号分段,加起来大于max时为一段文本。max<=0表示不分段。 |
|
482 |
+
| 流式响应 | streaming | false | false | bool | 流式合成语音,更快的首包响应。 |
|
483 |
+
|
484 |
+
## VITS 语音转换
|
485 |
+
|
486 |
+
| Name | Parameter | Is must | Default | Type | Instruction |
|
487 |
+
| ---------- | ----------- | ------- | ------- | ---- | ---------------------- |
|
488 |
+
| 上传音频 | upload | true | | file | wav or ogg |
|
489 |
+
| 源角色id | original_id | true | | int | 上传文件所使用的角色id |
|
490 |
+
| 目标角色id | target_id | true | | int | 要转换的目标角色id |
|
491 |
+
|
492 |
+
## HuBert-VITS 语音转换
|
493 |
+
|
494 |
+
| Name | Parameter | Is must | Default | Type | Instruction |
|
495 |
+
| ------------- | --------- | ------- | ------- | ----- | ------------------------------------------------ |
|
496 |
+
| 上传音频 | upload | true | | file | 需要转换说话人的音频文件。 |
|
497 |
+
| 目标角色id | id | true | | int | 目标说话人id。 |
|
498 |
+
| 音频格式 | format | true | | str | wav,ogg,silk |
|
499 |
+
| 语音长度/语速 | length | true | | float | 调节语音长度,相当于调节语速,该数值越大语速越慢 |
|
500 |
+
| 噪声 | noise | true | | float | 样本噪声,控制合成的随机性。 |
|
501 |
+
| sdp噪声 | noisew | true | | float | 随机时长预测器噪声,控制音素发音长度。 |
|
502 |
+
|
503 |
+
## W2V2-VITS
|
504 |
+
|
505 |
+
| Name | Parameter | Is must | Default | Type | Instruction |
|
506 |
+
| ------------- | --------- | ------- | ------------------- | ----- | ------------------------------------------------------------ |
|
507 |
+
| 合成文本 | text | true | | str | 需要合成语音的文本。 |
|
508 |
+
| 角色id | id | false | 从`config.py`中获取 | int | 即说话人id。 |
|
509 |
+
| 音频格式 | format | false | 从`config.py`中获取 | str | 支持wav,ogg,silk,mp3,flac |
|
510 |
+
| 文本语言 | lang | false | 从`config.py`中获取 | str | auto为自动识别语言模式,也是默认模式。lang=mix时,文本应该用[ZH] 或 [JA] 包裹。方言无法自动识别。 |
|
511 |
+
| 语音长度/语速 | length | false | 从`config.py`中获取 | float | 调节语音长度,相当于调节语速,该数值越大语速越慢 |
|
512 |
+
| 噪声 | noise | false | 从`config.py`中获取 | float | 样本噪声,控制合成的随机性。 |
|
513 |
+
| sdp噪声 | noisew | false | 从`config.py`中获取 | float | 随机时长预测器噪声,控制音素发音长度。 |
|
514 |
+
| 分段阈值 | max | false | 从`config.py`中获取 | int | 按标点符号分段,加起来大于max时为一段文本。max<=0表示不分段。 |
|
515 |
+
| 维度情感 | emotion | false | 0 | int | 范围取决于npy情感参考文件,如[innnky](https://huggingface.co/spaces/innnky/nene-emotion/tree/main)的all_emotions.npy模型范围是0-5457 |
|
516 |
+
|
517 |
+
## Dimensional emotion
|
518 |
+
|
519 |
+
| Name | Parameter | Is must | Default | Type | Instruction |
|
520 |
+
| -------- | --------- | ------- | ------- | ---- | ----------------------------- |
|
521 |
+
| 上传音频 | upload | true | | file | 返回存储维度情感向量的npy文件 |
|
522 |
+
|
523 |
+
## Bert-VITS2语音合成
|
524 |
+
|
525 |
+
| Name | Parameter | Is must | Default | Type | Instruction |
|
526 |
+
| ------------- | --------- | ------- | ------------------- | ----- | ------------------------------------------------------------ |
|
527 |
+
| 合成文本 | text | true | | str | 需要合成语音的文本。 |
|
528 |
+
| 角色id | id | false | 从`config.py`中获取 | int | 即说话人id。 |
|
529 |
+
| 音频格式 | format | false | 从`config.py`中获取 | str | 支持wav,ogg,silk,mp3,flac |
|
530 |
+
| 文本语言 | lang | false | 从`config.py`中获取 | str | 目前只有中文。 |
|
531 |
+
| 语音长度/语速 | length | false | 从`config.py`中获取 | float | 调节语音长度,相当于调节语速,该数值越大语速越慢。 |
|
532 |
+
| 噪声 | noise | false | 从`config.py`中获取 | float | 样本噪声,控制合成的随机性。 |
|
533 |
+
| sdp噪声 | noisew | false | 从`config.py`中获取 | float | 随机时长预测器噪声,控制音素发音长度。 |
|
534 |
+
| 分段阈值 | max | false | 从`config.py`中获取 | int | 按标点符号分段,加起来大于max时为一段文本。max<=0表示不分段。 |
|
535 |
+
| SDP/DP混合比 | sdp_ratio | false | 从`config.py`中获取 | int | SDP在合成时的占比,理论上此比率越高,合成的语音语调方差越大。 |
|
536 |
+
|
537 |
+
## SSML语音合成标记语言
|
538 |
+
目前支持的元素与属性
|
539 |
+
|
540 |
+
`speak`元素
|
541 |
+
|
542 |
+
| Attribute | Description | Is must |
|
543 |
+
| --------- | ------------------------------------------------------------ | ------- |
|
544 |
+
| id | 默认值从`config.py`中读取 | false |
|
545 |
+
| lang | 默认值从`config.py`中读取 | false |
|
546 |
+
| length | 默认值从`config.py`中读取 | false |
|
547 |
+
| noise | 默认值从`config.py`中读取 | false |
|
548 |
+
| noisew | 默认值从`config.py`中读取 | false |
|
549 |
+
| max | 按标点符号分段,加起来大于max时为一段文本。max<=0表示不分段,这里默认为0。 | false |
|
550 |
+
| model | 默认为vits,可选`w2v2-vits`,`emotion-vits` | false |
|
551 |
+
| emotion | 只有用`w2v2-vits`或`emotion-vits`时`emotion`才生效,范围取决于npy情感参考文件 | false |
|
552 |
+
|
553 |
+
`voice`元素
|
554 |
+
|
555 |
+
优先级大于`speak`
|
556 |
+
|
557 |
+
| Attribute | Description | Is must |
|
558 |
+
| --------- | ------------------------------------------------------------ | ------- |
|
559 |
+
| id | 默认值从`config.py`中读取 | false |
|
560 |
+
| lang | 默认值从`config.py`中读取 | false |
|
561 |
+
| length | 默认值从`config.py`中读取 | false |
|
562 |
+
| noise | 默认值从`config.py`中读取 | false |
|
563 |
+
| noisew | 默认值从`config.py`中读取 | false |
|
564 |
+
| max | 按标点符号分段,加起来大于max时为一段文本。max<=0表示不分段,这里默认为0。 | false |
|
565 |
+
| model | 默认为vits,可选`w2v2-vits`,`emotion-vits` | false |
|
566 |
+
| emotion | 只有用`w2v2-vits`或`emotion-vits`时`emotion`才会生效 | false |
|
567 |
+
|
568 |
+
`break`元素
|
569 |
+
|
570 |
+
| Attribute | Description | Is must |
|
571 |
+
| --------- | ------------------------------------------------------------ | ------- |
|
572 |
+
| strength | x-weak,weak,medium(默认值),strong,x-strong | false |
|
573 |
+
| time | 暂停的绝对持续时间,以秒为单位(例如 `2s`)或以毫秒为单位(例如 `500ms`)。 有效值的范围为 0 到 5000 毫秒。 如果设置的值大于支持的最大值,则服务将使用 `5000ms`。 如果设置了 `time` 属性,则会忽略 `strength` 属性。 | false |
|
574 |
+
|
575 |
+
| Strength | Relative Duration |
|
576 |
+
| :------- | :---------------- |
|
577 |
+
| x-weak | 250 毫秒 |
|
578 |
+
| weak | 500 毫秒 |
|
579 |
+
| Medium | 750 毫秒 |
|
580 |
+
| Strong | 1000 毫秒 |
|
581 |
+
| x-strong | 1250 毫秒 |
|
582 |
+
|
583 |
+
示例
|
584 |
+
|
585 |
+
```xml
|
586 |
+
<speak lang="zh" format="mp3" length="1.2">
|
587 |
+
<voice id="92" >这几天心里颇不宁静。</voice>
|
588 |
+
<voice id="125">今晚在院子里坐着乘凉,忽然想起日日走过的荷塘,在这满月的光里,总该另有一番样子吧。</voice>
|
589 |
+
<voice id="142">月亮渐渐地升高了,墙外马路上孩子们的欢笑,已经听不见了;</voice>
|
590 |
+
<voice id="98">妻在屋里拍着闰儿,迷迷糊糊地哼着眠歌。</voice>
|
591 |
+
<voice id="120">我悄悄地披了大衫,带上门出去。</voice><break time="2s"/>
|
592 |
+
<voice id="121">沿着荷塘,是一条曲折的小煤屑路。</voice>
|
593 |
+
<voice id="122">这是一条幽僻的路;白天也少人走,夜晚更加寂寞。</voice>
|
594 |
+
<voice id="123">荷塘四面,长着许多树,蓊蓊郁郁的。</voice>
|
595 |
+
<voice id="124">路的一旁,是些杨柳,和一些不知道名字的树。</voice>
|
596 |
+
<voice id="125">没有月光的晚上,这路上阴森森的,有些怕人。</voice>
|
597 |
+
<voice id="126">今晚却很好,虽然月光也还是淡淡的。</voice><break time="2s"/>
|
598 |
+
<voice id="127">路上只我一个人,背着手踱着。</voice>
|
599 |
+
<voice id="128">这一片天地好像是我的;我也像超出了平常的自己,到了另一个世界里。</voice>
|
600 |
+
<voice id="129">我爱热闹,也爱冷静;<break strength="x-weak"/>爱群居,也爱独处。</voice>
|
601 |
+
<voice id="130">像今晚上,一个人在这苍茫的月下,什么都可以想,什么都可以不想,便觉是个自由的人。</voice>
|
602 |
+
<voice id="131">白天里一定要做的事,一定要说的话,现在都可不理。</voice>
|
603 |
+
<voice id="132">这是独处的妙处,我且受用这无边的荷香月色好了。</voice>
|
604 |
+
</speak>
|
605 |
+
```
|
606 |
+
|
607 |
+
# 交流平台
|
608 |
+
|
609 |
+
现在只有 [Q群](https://qm.qq.com/cgi-bin/qm/qr?k=-1GknIe4uXrkmbDKBGKa1aAUteq40qs_&jump_from=webapi&authKey=x5YYt6Dggs1ZqWxvZqvj3fV8VUnxRyXm5S5Kzntc78+Nv3iXOIawplGip9LWuNR/)
|
610 |
+
|
611 |
+
# 鸣谢
|
612 |
+
|
613 |
+
- vits:https://github.com/jaywalnut310/vits
|
614 |
+
- MoeGoe:https://github.com/CjangCjengh/MoeGoe
|
615 |
+
- emotional-vits:https://github.com/innnky/emotional-vits
|
616 |
+
- vits-uma-genshin-honkai:https://huggingface.co/spaces/zomehwh/vits-uma-genshin-honkai
|
617 |
+
- vits_chinese:https://github.com/PlayVoice/vits_chinese
|
618 |
+
|
app.py
ADDED
@@ -0,0 +1,546 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import time
|
3 |
+
import uuid
|
4 |
+
from logger import logger
|
5 |
+
from flask import Flask, request, send_file, jsonify, make_response, render_template
|
6 |
+
from werkzeug.utils import secure_filename
|
7 |
+
from flask_apscheduler import APScheduler
|
8 |
+
from functools import wraps
|
9 |
+
from utils.utils import clean_folder, check_is_none
|
10 |
+
from utils.merge import merge_model
|
11 |
+
from io import BytesIO
|
12 |
+
|
13 |
+
app = Flask(__name__)
|
14 |
+
app.config.from_pyfile("config.py")
|
15 |
+
|
16 |
+
scheduler = APScheduler()
|
17 |
+
scheduler.init_app(app)
|
18 |
+
if app.config.get("CLEAN_INTERVAL_SECONDS", 3600) > 0:
|
19 |
+
scheduler.start()
|
20 |
+
|
21 |
+
for path in (app.config['LOGS_PATH'], app.config['UPLOAD_FOLDER'], app.config['CACHE_PATH']):
|
22 |
+
try:
|
23 |
+
os.makedirs(path, exist_ok=True)
|
24 |
+
except Exception as e:
|
25 |
+
logger.error(f"Unable to create directory {path}: {str(e)}")
|
26 |
+
|
27 |
+
# load model
|
28 |
+
tts = merge_model(app.config["MODEL_LIST"])
|
29 |
+
|
30 |
+
|
31 |
+
def require_api_key(func):
|
32 |
+
@wraps(func)
|
33 |
+
def check_api_key(*args, **kwargs):
|
34 |
+
if not app.config.get('API_KEY_ENABLED', False):
|
35 |
+
return func(*args, **kwargs)
|
36 |
+
else:
|
37 |
+
api_key = request.args.get('api_key') or request.headers.get('X-API-KEY')
|
38 |
+
if api_key and api_key == app.config['API_KEY']:
|
39 |
+
return func(*args, **kwargs)
|
40 |
+
else:
|
41 |
+
return make_response(jsonify({"status": "error", "message": "Invalid API Key"}), 401)
|
42 |
+
|
43 |
+
return check_api_key
|
44 |
+
|
45 |
+
|
46 |
+
@app.route('/', methods=["GET", "POST"])
|
47 |
+
def index():
|
48 |
+
kwargs = {
|
49 |
+
"speakers": tts.voice_speakers,
|
50 |
+
"speakers_count": tts.speakers_count,
|
51 |
+
"vits_speakers_count": tts.vits_speakers_count,
|
52 |
+
"w2v2_speakers_count": tts.w2v2_speakers_count,
|
53 |
+
"w2v2_emotion_count": tts.w2v2_emotion_count,
|
54 |
+
"bert_vits2_speakers_count": tts.bert_vits2_speakers_count
|
55 |
+
}
|
56 |
+
return render_template("index.html", **kwargs)
|
57 |
+
|
58 |
+
|
59 |
+
@app.route('/voice/speakers', methods=["GET", "POST"])
|
60 |
+
def voice_speakers_api():
|
61 |
+
return jsonify(tts.voice_speakers)
|
62 |
+
|
63 |
+
|
64 |
+
@app.route('/voice', methods=["GET", "POST"])
|
65 |
+
@app.route('/voice/vits', methods=["GET", "POST"])
|
66 |
+
@require_api_key
|
67 |
+
def voice_vits_api():
|
68 |
+
try:
|
69 |
+
if request.method == "GET":
|
70 |
+
text = request.args.get("text", "")
|
71 |
+
id = int(request.args.get("id", app.config.get("ID", 0)))
|
72 |
+
format = request.args.get("format", app.config.get("FORMAT", "wav"))
|
73 |
+
lang = request.args.get("lang", app.config.get("LANG", "auto"))
|
74 |
+
length = float(request.args.get("length", app.config.get("LENGTH", 1)))
|
75 |
+
noise = float(request.args.get("noise", app.config.get("NOISE", 0.667)))
|
76 |
+
noisew = float(request.args.get("noisew", app.config.get("NOISEW", 0.8)))
|
77 |
+
max = int(request.args.get("max", app.config.get("MAX", 50)))
|
78 |
+
use_streaming = request.args.get('streaming', False, type=bool)
|
79 |
+
elif request.method == "POST":
|
80 |
+
content_type = request.headers.get('Content-Type')
|
81 |
+
if content_type == 'application/json':
|
82 |
+
data = request.get_json()
|
83 |
+
else:
|
84 |
+
data = request.form
|
85 |
+
text = data.get("text", "")
|
86 |
+
id = int(data.get("id", app.config.get("ID", 0)))
|
87 |
+
format = data.get("format", app.config.get("FORMAT", "wav"))
|
88 |
+
lang = data.get("lang", app.config.get("LANG", "auto"))
|
89 |
+
length = float(data.get("length", app.config.get("LENGTH", 1)))
|
90 |
+
noise = float(data.get("noise", app.config.get("NOISE", 0.667)))
|
91 |
+
noisew = float(data.get("noisew", app.config.get("NOISEW", 0.8)))
|
92 |
+
max = int(data.get("max", app.config.get("MAX", 50)))
|
93 |
+
use_streaming = request.form.get('streaming', False, type=bool)
|
94 |
+
except Exception as e:
|
95 |
+
logger.error(f"[VITS] {e}")
|
96 |
+
return make_response("parameter error", 400)
|
97 |
+
|
98 |
+
logger.info(f"[VITS] id:{id} format:{format} lang:{lang} length:{length} noise:{noise} noisew:{noisew}")
|
99 |
+
logger.info(f"[VITS] len:{len(text)} text:{text}")
|
100 |
+
|
101 |
+
if check_is_none(text):
|
102 |
+
logger.info(f"[VITS] text is empty")
|
103 |
+
return make_response(jsonify({"status": "error", "message": "text is empty"}), 400)
|
104 |
+
|
105 |
+
if check_is_none(id):
|
106 |
+
logger.info(f"[VITS] speaker id is empty")
|
107 |
+
return make_response(jsonify({"status": "error", "message": "speaker id is empty"}), 400)
|
108 |
+
|
109 |
+
if id < 0 or id >= tts.vits_speakers_count:
|
110 |
+
logger.info(f"[VITS] speaker id {id} does not exist")
|
111 |
+
return make_response(jsonify({"status": "error", "message": f"id {id} does not exist"}), 400)
|
112 |
+
|
113 |
+
# 校验模型是否支持输入的语言
|
114 |
+
speaker_lang = tts.voice_speakers["VITS"][id].get('lang')
|
115 |
+
if lang.upper() != "AUTO" and lang.upper() != "MIX" and len(speaker_lang) != 1 and lang not in speaker_lang:
|
116 |
+
logger.info(f"[VITS] lang \"{lang}\" is not in {speaker_lang}")
|
117 |
+
return make_response(jsonify({"status": "error", "message": f"lang '{lang}' is not in {speaker_lang}"}), 400)
|
118 |
+
|
119 |
+
# 如果配置文件中设置了LANGUAGE_AUTOMATIC_DETECT则强制将speaker_lang设置为LANGUAGE_AUTOMATIC_DETECT
|
120 |
+
if app.config.get("LANGUAGE_AUTOMATIC_DETECT", []) != []:
|
121 |
+
speaker_lang = app.config.get("LANGUAGE_AUTOMATIC_DETECT")
|
122 |
+
|
123 |
+
if use_streaming and format.upper() != "MP3":
|
124 |
+
format = "mp3"
|
125 |
+
logger.warning("Streaming response only supports MP3 format.")
|
126 |
+
|
127 |
+
fname = f"{str(uuid.uuid1())}.{format}"
|
128 |
+
file_type = f"audio/{format}"
|
129 |
+
task = {"text": text,
|
130 |
+
"id": id,
|
131 |
+
"format": format,
|
132 |
+
"length": length,
|
133 |
+
"noise": noise,
|
134 |
+
"noisew": noisew,
|
135 |
+
"max": max,
|
136 |
+
"lang": lang,
|
137 |
+
"speaker_lang": speaker_lang}
|
138 |
+
|
139 |
+
if app.config.get("SAVE_AUDIO", False):
|
140 |
+
logger.debug(f"[VITS] {fname}")
|
141 |
+
|
142 |
+
if use_streaming:
|
143 |
+
audio = tts.stream_vits_infer(task, fname)
|
144 |
+
response = make_response(audio)
|
145 |
+
response.headers['Content-Disposition'] = f'attachment; filename={fname}'
|
146 |
+
response.headers['Content-Type'] = file_type
|
147 |
+
return response
|
148 |
+
else:
|
149 |
+
t1 = time.time()
|
150 |
+
audio = tts.vits_infer(task, fname)
|
151 |
+
t2 = time.time()
|
152 |
+
logger.info(f"[VITS] finish in {(t2 - t1):.2f}s")
|
153 |
+
return send_file(path_or_file=audio, mimetype=file_type, download_name=fname)
|
154 |
+
|
155 |
+
|
156 |
+
@app.route('/voice/hubert-vits', methods=["POST"])
|
157 |
+
@require_api_key
|
158 |
+
def voice_hubert_api():
|
159 |
+
if request.method == "POST":
|
160 |
+
try:
|
161 |
+
voice = request.files['upload']
|
162 |
+
id = int(request.form.get("id"))
|
163 |
+
format = request.form.get("format", app.config.get("LANG", "auto"))
|
164 |
+
length = float(request.form.get("length", app.config.get("LENGTH", 1)))
|
165 |
+
noise = float(request.form.get("noise", app.config.get("NOISE", 0.667)))
|
166 |
+
noisew = float(request.form.get("noisew", app.config.get("NOISEW", 0.8)))
|
167 |
+
use_streaming = request.form.get('streaming', False, type=bool)
|
168 |
+
except Exception as e:
|
169 |
+
logger.error(f"[hubert] {e}")
|
170 |
+
return make_response("parameter error", 400)
|
171 |
+
|
172 |
+
logger.info(f"[hubert] id:{id} format:{format} length:{length} noise:{noise} noisew:{noisew}")
|
173 |
+
|
174 |
+
fname = secure_filename(str(uuid.uuid1()) + "." + voice.filename.split(".")[1])
|
175 |
+
voice.save(os.path.join(app.config['UPLOAD_FOLDER'], fname))
|
176 |
+
|
177 |
+
if check_is_none(id):
|
178 |
+
logger.info(f"[hubert] speaker id is empty")
|
179 |
+
return make_response(jsonify({"status": "error", "message": "speaker id is empty"}), 400)
|
180 |
+
|
181 |
+
if id < 0 or id >= tts.hubert_speakers_count:
|
182 |
+
logger.info(f"[hubert] speaker id {id} does not exist")
|
183 |
+
return make_response(jsonify({"status": "error", "message": f"id {id} does not exist"}), 400)
|
184 |
+
|
185 |
+
file_type = f"audio/{format}"
|
186 |
+
task = {"id": id,
|
187 |
+
"format": format,
|
188 |
+
"length": length,
|
189 |
+
"noise": noise,
|
190 |
+
"noisew": noisew,
|
191 |
+
"audio_path": os.path.join(app.config['UPLOAD_FOLDER'], fname)}
|
192 |
+
|
193 |
+
t1 = time.time()
|
194 |
+
audio = tts.hubert_vits_infer(task, fname)
|
195 |
+
t2 = time.time()
|
196 |
+
if app.config.get("SAVE_AUDIO", False):
|
197 |
+
logger.debug(f"[hubert] {fname}")
|
198 |
+
logger.info(f"[hubert] finish in {(t2 - t1):.2f}s")
|
199 |
+
if use_streaming:
|
200 |
+
audio = tts.generate_audio_chunks(audio)
|
201 |
+
response = make_response(audio)
|
202 |
+
response.headers['Content-Disposition'] = f'attachment; filename={fname}'
|
203 |
+
response.headers['Content-Type'] = file_type
|
204 |
+
return response
|
205 |
+
else:
|
206 |
+
return send_file(path_or_file=audio, mimetype=file_type, download_name=fname)
|
207 |
+
|
208 |
+
|
209 |
+
@app.route('/voice/w2v2-vits', methods=["GET", "POST"])
|
210 |
+
@require_api_key
|
211 |
+
def voice_w2v2_api():
|
212 |
+
try:
|
213 |
+
if request.method == "GET":
|
214 |
+
text = request.args.get("text", "")
|
215 |
+
id = int(request.args.get("id", app.config.get("ID", 0)))
|
216 |
+
format = request.args.get("format", app.config.get("FORMAT", "wav"))
|
217 |
+
lang = request.args.get("lang", app.config.get("LANG", "auto"))
|
218 |
+
length = float(request.args.get("length", app.config.get("LENGTH", 1)))
|
219 |
+
noise = float(request.args.get("noise", app.config.get("NOISE", 0.667)))
|
220 |
+
noisew = float(request.args.get("noisew", app.config.get("NOISEW", 0.8)))
|
221 |
+
max = int(request.args.get("max", app.config.get("MAX", 50)))
|
222 |
+
emotion = int(request.args.get("emotion", app.config.get("EMOTION", 0)))
|
223 |
+
use_streaming = request.args.get('streaming', False, type=bool)
|
224 |
+
elif request.method == "POST":
|
225 |
+
content_type = request.headers.get('Content-Type')
|
226 |
+
if content_type == 'application/json':
|
227 |
+
data = request.get_json()
|
228 |
+
else:
|
229 |
+
data = request.form
|
230 |
+
text = data.get("text", "")
|
231 |
+
id = int(data.get("id", app.config.get("ID", 0)))
|
232 |
+
format = data.get("format", app.config.get("FORMAT", "wav"))
|
233 |
+
lang = data.get("lang", app.config.get("LANG", "auto"))
|
234 |
+
length = float(data.get("length"))
|
235 |
+
noise = float(data.get("noise", app.config.get("NOISE", 0.667)))
|
236 |
+
noisew = float(data.get("noisew", app.config.get("NOISEW", 0.8)))
|
237 |
+
max = int(data.get("max", app.config.get("MAX", 50)))
|
238 |
+
emotion = int(data.get("emotion", app.config.get("EMOTION", 0)))
|
239 |
+
use_streaming = request.form.get('streaming', False, type=bool)
|
240 |
+
except Exception as e:
|
241 |
+
logger.error(f"[w2v2] {e}")
|
242 |
+
return make_response(f"parameter error", 400)
|
243 |
+
|
244 |
+
logger.info(f"[w2v2] id:{id} format:{format} lang:{lang} "
|
245 |
+
f"length:{length} noise:{noise} noisew:{noisew} emotion:{emotion}")
|
246 |
+
logger.info(f"[w2v2] len:{len(text)} text:{text}")
|
247 |
+
|
248 |
+
if check_is_none(text):
|
249 |
+
logger.info(f"[w2v2] text is empty")
|
250 |
+
return make_response(jsonify({"status": "error", "message": "text is empty"}), 400)
|
251 |
+
|
252 |
+
if check_is_none(id):
|
253 |
+
logger.info(f"[w2v2] speaker id is empty")
|
254 |
+
return make_response(jsonify({"status": "error", "message": "speaker id is empty"}), 400)
|
255 |
+
|
256 |
+
if id < 0 or id >= tts.w2v2_speakers_count:
|
257 |
+
logger.info(f"[w2v2] speaker id {id} does not exist")
|
258 |
+
return make_response(jsonify({"status": "error", "message": f"id {id} does not exist"}), 400)
|
259 |
+
|
260 |
+
# 校验模型是否支持输入的语言
|
261 |
+
speaker_lang = tts.voice_speakers["W2V2-VITS"][id].get('lang')
|
262 |
+
if lang.upper() != "AUTO" and lang.upper() != "MIX" and len(speaker_lang) != 1 and lang not in speaker_lang:
|
263 |
+
logger.info(f"[w2v2] lang \"{lang}\" is not in {speaker_lang}")
|
264 |
+
return make_response(jsonify({"status": "error", "message": f"lang '{lang}' is not in {speaker_lang}"}), 400)
|
265 |
+
|
266 |
+
# 如果配置文件中设置了LANGUAGE_AUTOMATIC_DETECT则强制将speaker_lang设置为LANGUAGE_AUTOMATIC_DETECT
|
267 |
+
if app.config.get("LANGUAGE_AUTOMATIC_DETECT", []) != []:
|
268 |
+
speaker_lang = app.config.get("LANGUAGE_AUTOMATIC_DETECT")
|
269 |
+
|
270 |
+
if use_streaming and format.upper() != "MP3":
|
271 |
+
format = "mp3"
|
272 |
+
logger.warning("Streaming response only supports MP3 format.")
|
273 |
+
|
274 |
+
fname = f"{str(uuid.uuid1())}.{format}"
|
275 |
+
file_type = f"audio/{format}"
|
276 |
+
task = {"text": text,
|
277 |
+
"id": id,
|
278 |
+
"format": format,
|
279 |
+
"length": length,
|
280 |
+
"noise": noise,
|
281 |
+
"noisew": noisew,
|
282 |
+
"max": max,
|
283 |
+
"lang": lang,
|
284 |
+
"emotion": emotion,
|
285 |
+
"speaker_lang": speaker_lang}
|
286 |
+
|
287 |
+
t1 = time.time()
|
288 |
+
audio = tts.w2v2_vits_infer(task, fname)
|
289 |
+
t2 = time.time()
|
290 |
+
if app.config.get("SAVE_AUDIO", False):
|
291 |
+
logger.debug(f"[W2V2] {fname}")
|
292 |
+
if use_streaming:
|
293 |
+
audio = tts.generate_audio_chunks(audio)
|
294 |
+
response = make_response(audio)
|
295 |
+
response.headers['Content-Disposition'] = f'attachment; filename={fname}'
|
296 |
+
response.headers['Content-Type'] = file_type
|
297 |
+
return response
|
298 |
+
else:
|
299 |
+
logger.info(f"[w2v2] finish in {(t2 - t1):.2f}s")
|
300 |
+
return send_file(path_or_file=audio, mimetype=file_type, download_name=fname)
|
301 |
+
|
302 |
+
|
303 |
+
@app.route('/voice/conversion', methods=["POST"])
|
304 |
+
@app.route('/voice/vits/conversion', methods=["POST"])
|
305 |
+
@require_api_key
|
306 |
+
def vits_voice_conversion_api():
|
307 |
+
if request.method == "POST":
|
308 |
+
try:
|
309 |
+
voice = request.files['upload']
|
310 |
+
original_id = int(request.form["original_id"])
|
311 |
+
target_id = int(request.form["target_id"])
|
312 |
+
format = request.form.get("format", voice.filename.split(".")[1])
|
313 |
+
use_streaming = request.form.get('streaming', False, type=bool)
|
314 |
+
except Exception as e:
|
315 |
+
logger.error(f"[vits_voice_convertsion] {e}")
|
316 |
+
return make_response("parameter error", 400)
|
317 |
+
|
318 |
+
logger.info(f"[vits_voice_convertsion] orginal_id:{original_id} target_id:{target_id}")
|
319 |
+
fname = secure_filename(str(uuid.uuid1()) + "." + voice.filename.split(".")[1])
|
320 |
+
audio_path = os.path.join(app.config['UPLOAD_FOLDER'], fname)
|
321 |
+
voice.save(audio_path)
|
322 |
+
file_type = f"audio/{format}"
|
323 |
+
task = {"audio_path": audio_path,
|
324 |
+
"original_id": original_id,
|
325 |
+
"target_id": target_id,
|
326 |
+
"format": format}
|
327 |
+
|
328 |
+
t1 = time.time()
|
329 |
+
audio = tts.vits_voice_conversion(task, fname)
|
330 |
+
t2 = time.time()
|
331 |
+
if app.config.get("SAVE_AUDIO", False):
|
332 |
+
logger.debug(f"[Voice conversion] {fname}")
|
333 |
+
logger.info(f"[Voice conversion] finish in {(t2 - t1):.2f}s")
|
334 |
+
if use_streaming:
|
335 |
+
audio = tts.generate_audio_chunks(audio)
|
336 |
+
response = make_response(audio)
|
337 |
+
response.headers['Content-Disposition'] = f'attachment; filename={fname}'
|
338 |
+
response.headers['Content-Type'] = file_type
|
339 |
+
return response
|
340 |
+
else:
|
341 |
+
return send_file(path_or_file=audio, mimetype=file_type, download_name=fname)
|
342 |
+
|
343 |
+
|
344 |
+
@app.route('/voice/ssml', methods=["POST"])
|
345 |
+
@require_api_key
|
346 |
+
def ssml():
|
347 |
+
try:
|
348 |
+
content_type = request.headers.get('Content-Type')
|
349 |
+
if content_type == 'application/json':
|
350 |
+
data = request.get_json()
|
351 |
+
else:
|
352 |
+
data = request.form
|
353 |
+
ssml = data.get("ssml")
|
354 |
+
except Exception as e:
|
355 |
+
logger.info(f"[ssml] {e}")
|
356 |
+
return make_response(jsonify({"status": "error", "message": f"parameter error"}), 400)
|
357 |
+
|
358 |
+
logger.debug(ssml)
|
359 |
+
voice_tasks, format = tts.parse_ssml(ssml)
|
360 |
+
fname = f"{str(uuid.uuid1())}.{format}"
|
361 |
+
file_type = f"audio/{format}"
|
362 |
+
|
363 |
+
t1 = time.time()
|
364 |
+
audio = tts.create_ssml_infer_task(voice_tasks, format, fname)
|
365 |
+
t2 = time.time()
|
366 |
+
if app.config.get("SAVE_AUDIO", False):
|
367 |
+
logger.debug(f"[ssml] {fname}")
|
368 |
+
logger.info(f"[ssml] finish in {(t2 - t1):.2f}s")
|
369 |
+
|
370 |
+
return send_file(path_or_file=audio, mimetype=file_type, download_name=fname)
|
371 |
+
|
372 |
+
|
373 |
+
@app.route('/voice/dimension-emotion', methods=["POST"])
|
374 |
+
@require_api_key
|
375 |
+
def dimensional_emotion():
|
376 |
+
if request.method == "POST":
|
377 |
+
try:
|
378 |
+
audio = request.files['upload']
|
379 |
+
use_streaming = request.form.get('streaming', False, type=bool)
|
380 |
+
except Exception as e:
|
381 |
+
logger.error(f"[dimensional_emotion] {e}")
|
382 |
+
return make_response("parameter error", 400)
|
383 |
+
|
384 |
+
content = BytesIO(audio.read())
|
385 |
+
|
386 |
+
file_type = "application/octet-stream; charset=ascii"
|
387 |
+
fname = os.path.splitext(audio.filename)[0] + ".npy"
|
388 |
+
audio = tts.get_dimensional_emotion_npy(content)
|
389 |
+
if use_streaming:
|
390 |
+
audio = tts.generate_audio_chunks(audio)
|
391 |
+
response = make_response(audio)
|
392 |
+
response.headers['Content-Disposition'] = f'attachment; filename={fname}'
|
393 |
+
response.headers['Content-Type'] = file_type
|
394 |
+
return response
|
395 |
+
else:
|
396 |
+
return send_file(path_or_file=audio, mimetype=file_type, download_name=fname)
|
397 |
+
|
398 |
+
|
399 |
+
@app.route('/voice/bert-vits2', methods=["GET", "POST"])
|
400 |
+
@require_api_key
|
401 |
+
def voice_bert_vits2_api():
|
402 |
+
try:
|
403 |
+
if request.method == "GET":
|
404 |
+
text = request.args.get("text", "")
|
405 |
+
id = int(request.args.get("id", app.config.get("ID", 0)))
|
406 |
+
format = request.args.get("format", app.config.get("FORMAT", "wav"))
|
407 |
+
# lang = request.args.get("lang", app.config.get("LANG", "auto"))
|
408 |
+
lang = "ZH"
|
409 |
+
length = float(request.args.get("length", app.config.get("LENGTH", 1)))
|
410 |
+
noise = float(request.args.get("noise", app.config.get("NOISE", 0.5)))
|
411 |
+
noisew = float(request.args.get("noisew", app.config.get("NOISEW", 0.6)))
|
412 |
+
sdp_ratio = float(request.args.get("sdp_ratio", 0.2))
|
413 |
+
max = int(request.args.get("max", app.config.get("MAX", 50)))
|
414 |
+
elif request.method == "POST":
|
415 |
+
content_type = request.headers.get('Content-Type')
|
416 |
+
if content_type == 'application/json':
|
417 |
+
data = request.get_json()
|
418 |
+
else:
|
419 |
+
data = request.form
|
420 |
+
text = data.get("text", "")
|
421 |
+
id = int(data.get("id", app.config.get("ID", 0)))
|
422 |
+
format = data.get("format", app.config.get("FORMAT", "wav"))
|
423 |
+
# lang = data.get("lang", app.config.get("LANG", "auto"))
|
424 |
+
lang = "ZH"
|
425 |
+
length = float(data.get("length", app.config.get("LENGTH", 1)))
|
426 |
+
noise = float(data.get("noise", app.config.get("NOISE", 0.667)))
|
427 |
+
noisew = float(data.get("noisew", app.config.get("NOISEW", 0.8)))
|
428 |
+
sdp_ratio = float(data.get("noisew", app.config.get("SDP_RATIO", 0.2)))
|
429 |
+
max = int(data.get("max", app.config.get("MAX", 50)))
|
430 |
+
except Exception as e:
|
431 |
+
logger.error(f"[Bert-VITS2] {e}")
|
432 |
+
return make_response("parameter error", 400)
|
433 |
+
|
434 |
+
logger.info(f"[Bert-VITS2] id:{id} format:{format} lang:{lang} length:{length} noise:{noise} noisew:{noisew} sdp_ratio:{sdp_ratio}")
|
435 |
+
logger.info(f"[Bert-VITS2] len:{len(text)} text:{text}")
|
436 |
+
|
437 |
+
if check_is_none(text):
|
438 |
+
logger.info(f"[Bert-VITS2] text is empty")
|
439 |
+
return make_response(jsonify({"status": "error", "message": "text is empty"}), 400)
|
440 |
+
|
441 |
+
if check_is_none(id):
|
442 |
+
logger.info(f"[Bert-VITS2] speaker id is empty")
|
443 |
+
return make_response(jsonify({"status": "error", "message": "speaker id is empty"}), 400)
|
444 |
+
|
445 |
+
if id < 0 or id >= tts.bert_vits2_speakers_count:
|
446 |
+
logger.info(f"[Bert-VITS2] speaker id {id} does not exist")
|
447 |
+
return make_response(jsonify({"status": "error", "message": f"id {id} does not exist"}), 400)
|
448 |
+
|
449 |
+
# 校验模型是否支持输入的语言
|
450 |
+
speaker_lang = tts.voice_speakers["BERT-VITS2"][id].get('lang')
|
451 |
+
if lang.upper() != "AUTO" and lang.upper() != "MIX" and len(speaker_lang) != 1 and lang not in speaker_lang:
|
452 |
+
logger.info(f"[Bert-VITS2] lang \"{lang}\" is not in {speaker_lang}")
|
453 |
+
return make_response(jsonify({"status": "error", "message": f"lang '{lang}' is not in {speaker_lang}"}), 400)
|
454 |
+
|
455 |
+
# 如果配置文件中设置了LANGUAGE_AUTOMATIC_DETECT则强制将speaker_lang设置为LANGUAGE_AUTOMATIC_DETECT
|
456 |
+
if app.config.get("LANGUAGE_AUTOMATIC_DETECT", []) != []:
|
457 |
+
speaker_lang = app.config.get("LANGUAGE_AUTOMATIC_DETECT")
|
458 |
+
|
459 |
+
fname = f"{str(uuid.uuid1())}.{format}"
|
460 |
+
file_type = f"audio/{format}"
|
461 |
+
task = {"text": text,
|
462 |
+
"id": id,
|
463 |
+
"format": format,
|
464 |
+
"length": length,
|
465 |
+
"noise": noise,
|
466 |
+
"noisew": noisew,
|
467 |
+
"sdp_ratio": sdp_ratio,
|
468 |
+
"max": max,
|
469 |
+
"lang": lang,
|
470 |
+
"speaker_lang": speaker_lang}
|
471 |
+
|
472 |
+
if app.config.get("SAVE_AUDIO", False):
|
473 |
+
logger.debug(f"[Bert-VITS2] {fname}")
|
474 |
+
|
475 |
+
|
476 |
+
t1 = time.time()
|
477 |
+
audio = tts.bert_vits2_infer(task, fname)
|
478 |
+
t2 = time.time()
|
479 |
+
logger.info(f"[Bert-VITS2] finish in {(t2 - t1):.2f}s")
|
480 |
+
return send_file(path_or_file=audio, mimetype=file_type, download_name=fname)
|
481 |
+
|
482 |
+
|
483 |
+
@app.route('/voice/check', methods=["GET", "POST"])
|
484 |
+
def check():
|
485 |
+
try:
|
486 |
+
if request.method == "GET":
|
487 |
+
model = request.args.get("model")
|
488 |
+
id = int(request.args.get("id"))
|
489 |
+
elif request.method == "POST":
|
490 |
+
content_type = request.headers.get('Content-Type')
|
491 |
+
if content_type == 'application/json':
|
492 |
+
data = request.get_json()
|
493 |
+
else:
|
494 |
+
data = request.form
|
495 |
+
model = data.get("model")
|
496 |
+
id = int(data.get("id"))
|
497 |
+
except Exception as e:
|
498 |
+
logger.info(f"[check] {e}")
|
499 |
+
return make_response(jsonify({"status": "error", "message": "parameter error"}), 400)
|
500 |
+
|
501 |
+
if check_is_none(model):
|
502 |
+
logger.info(f"[check] model {model} is empty")
|
503 |
+
return make_response(jsonify({"status": "error", "message": "model is empty"}), 400)
|
504 |
+
|
505 |
+
if model.upper() not in ("VITS", "HUBERT", "W2V2"):
|
506 |
+
res = make_response(jsonify({"status": "error", "message": f"model {model} does not exist"}))
|
507 |
+
res.status = 404
|
508 |
+
logger.info(f"[check] speaker id {id} error")
|
509 |
+
return res
|
510 |
+
|
511 |
+
if check_is_none(id):
|
512 |
+
logger.info(f"[check] speaker id is empty")
|
513 |
+
return make_response(jsonify({"status": "error", "message": "speaker id is empty"}), 400)
|
514 |
+
|
515 |
+
if model.upper() == "VITS":
|
516 |
+
speaker_list = tts.voice_speakers["VITS"]
|
517 |
+
elif model.upper() == "HUBERT":
|
518 |
+
speaker_list = tts.voice_speakers["HUBERT-VITS"]
|
519 |
+
elif model.upper() == "W2V2":
|
520 |
+
speaker_list = tts.voice_speakers["W2V2-VITS"]
|
521 |
+
|
522 |
+
if len(speaker_list) == 0:
|
523 |
+
logger.info(f"[check] {model} not loaded")
|
524 |
+
return make_response(jsonify({"status": "error", "message": f"{model} not loaded"}), 400)
|
525 |
+
|
526 |
+
if id < 0 or id >= len(speaker_list):
|
527 |
+
logger.info(f"[check] speaker id {id} does not exist")
|
528 |
+
return make_response(jsonify({"status": "error", "message": f"id {id} does not exist"}), 400)
|
529 |
+
name = str(speaker_list[id]["name"])
|
530 |
+
lang = speaker_list[id]["lang"]
|
531 |
+
logger.info(f"[check] check id:{id} name:{name} lang:{lang}")
|
532 |
+
|
533 |
+
return make_response(jsonify({"status": "success", "id": id, "name": name, "lang": lang}), 200)
|
534 |
+
|
535 |
+
|
536 |
+
# regular cleaning
|
537 |
+
@scheduler.task('interval', id='clean_task', seconds=app.config.get("CLEAN_INTERVAL_SECONDS", 3600),
|
538 |
+
misfire_grace_time=900)
|
539 |
+
def clean_task():
|
540 |
+
clean_folder(app.config["UPLOAD_FOLDER"])
|
541 |
+
clean_folder(app.config["CACHE_PATH"])
|
542 |
+
|
543 |
+
|
544 |
+
if __name__ == '__main__':
|
545 |
+
app.run(host='0.0.0.0', port=app.config.get("PORT", 23456), debug=app.config.get("DEBUG", False)) # 对外开放
|
546 |
+
# app.run(host='127.0.0.1', port=app.config.get("PORT",23456), debug=True) # 本地运行、调试
|
bert_vits2/LICENSE
ADDED
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 29 June 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
6 |
+
of this license document, but changing it is not allowed.
|
7 |
+
|
8 |
+
Preamble
|
9 |
+
|
10 |
+
The GNU General Public License is a free, copyleft license for
|
11 |
+
software and other kinds of works.
|
12 |
+
|
13 |
+
The licenses for most software and other practical works are designed
|
14 |
+
to take away your freedom to share and change the works. By contrast,
|
15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
16 |
+
share and change all versions of a program--to make sure it remains free
|
17 |
+
software for all its users. We, the Free Software Foundation, use the
|
18 |
+
GNU General Public License for most of our software; it applies also to
|
19 |
+
any other work released this way by its authors. You can apply it to
|
20 |
+
your programs, too.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
them if you wish), that you receive source code or can get it if you
|
26 |
+
want it, that you can change the software or use pieces of it in new
|
27 |
+
free programs, and that you know you can do these things.
|
28 |
+
|
29 |
+
To protect your rights, we need to prevent others from denying you
|
30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
+
certain responsibilities if you distribute copies of the software, or if
|
32 |
+
you modify it: responsibilities to respect the freedom of others.
|
33 |
+
|
34 |
+
For example, if you distribute copies of such a program, whether
|
35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
36 |
+
freedoms that you received. You must make sure that they, too, receive
|
37 |
+
or can get the source code. And you must show them these terms so they
|
38 |
+
know their rights.
|
39 |
+
|
40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
43 |
+
|
44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
45 |
+
that there is no warranty for this free software. For both users' and
|
46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
47 |
+
changed, so that their problems will not be attributed erroneously to
|
48 |
+
authors of previous versions.
|
49 |
+
|
50 |
+
Some devices are designed to deny users access to install or run
|
51 |
+
modified versions of the software inside them, although the manufacturer
|
52 |
+
can do so. This is fundamentally incompatible with the aim of
|
53 |
+
protecting users' freedom to change the software. The systematic
|
54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
+
have designed this version of the GPL to prohibit the practice for those
|
57 |
+
products. If such problems arise substantially in other domains, we
|
58 |
+
stand ready to extend this provision to those domains in future versions
|
59 |
+
of the GPL, as needed to protect the freedom of users.
|
60 |
+
|
61 |
+
Finally, every program is threatened constantly by software patents.
|
62 |
+
States should not allow patents to restrict development and use of
|
63 |
+
software on general-purpose computers, but in those that do, we wish to
|
64 |
+
avoid the special danger that patents applied to a free program could
|
65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
+
patents cannot be used to render the program non-free.
|
67 |
+
|
68 |
+
The precise terms and conditions for copying, distribution and
|
69 |
+
modification follow.
|
70 |
+
|
71 |
+
TERMS AND CONDITIONS
|
72 |
+
|
73 |
+
0. Definitions.
|
74 |
+
|
75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
76 |
+
|
77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
+
works, such as semiconductor masks.
|
79 |
+
|
80 |
+
"The Program" refers to any copyrightable work licensed under this
|
81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
+
"recipients" may be individuals or organizations.
|
83 |
+
|
84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
+
in a fashion requiring copyright permission, other than the making of an
|
86 |
+
exact copy. The resulting work is called a "modified version" of the
|
87 |
+
earlier work or a work "based on" the earlier work.
|
88 |
+
|
89 |
+
A "covered work" means either the unmodified Program or a work based
|
90 |
+
on the Program.
|
91 |
+
|
92 |
+
To "propagate" a work means to do anything with it that, without
|
93 |
+
permission, would make you directly or secondarily liable for
|
94 |
+
infringement under applicable copyright law, except executing it on a
|
95 |
+
computer or modifying a private copy. Propagation includes copying,
|
96 |
+
distribution (with or without modification), making available to the
|
97 |
+
public, and in some countries other activities as well.
|
98 |
+
|
99 |
+
To "convey" a work means any kind of propagation that enables other
|
100 |
+
parties to make or receive copies. Mere interaction with a user through
|
101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
102 |
+
|
103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
+
to the extent that it includes a convenient and prominently visible
|
105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
+
tells the user that there is no warranty for the work (except to the
|
107 |
+
extent that warranties are provided), that licensees may convey the
|
108 |
+
work under this License, and how to view a copy of this License. If
|
109 |
+
the interface presents a list of user commands or options, such as a
|
110 |
+
menu, a prominent item in the list meets this criterion.
|
111 |
+
|
112 |
+
1. Source Code.
|
113 |
+
|
114 |
+
The "source code" for a work means the preferred form of the work
|
115 |
+
for making modifications to it. "Object code" means any non-source
|
116 |
+
form of a work.
|
117 |
+
|
118 |
+
A "Standard Interface" means an interface that either is an official
|
119 |
+
standard defined by a recognized standards body, or, in the case of
|
120 |
+
interfaces specified for a particular programming language, one that
|
121 |
+
is widely used among developers working in that language.
|
122 |
+
|
123 |
+
The "System Libraries" of an executable work include anything, other
|
124 |
+
than the work as a whole, that (a) is included in the normal form of
|
125 |
+
packaging a Major Component, but which is not part of that Major
|
126 |
+
Component, and (b) serves only to enable use of the work with that
|
127 |
+
Major Component, or to implement a Standard Interface for which an
|
128 |
+
implementation is available to the public in source code form. A
|
129 |
+
"Major Component", in this context, means a major essential component
|
130 |
+
(kernel, window system, and so on) of the specific operating system
|
131 |
+
(if any) on which the executable work runs, or a compiler used to
|
132 |
+
produce the work, or an object code interpreter used to run it.
|
133 |
+
|
134 |
+
The "Corresponding Source" for a work in object code form means all
|
135 |
+
the source code needed to generate, install, and (for an executable
|
136 |
+
work) run the object code and to modify the work, including scripts to
|
137 |
+
control those activities. However, it does not include the work's
|
138 |
+
System Libraries, or general-purpose tools or generally available free
|
139 |
+
programs which are used unmodified in performing those activities but
|
140 |
+
which are not part of the work. For example, Corresponding Source
|
141 |
+
includes interface definition files associated with source files for
|
142 |
+
the work, and the source code for shared libraries and dynamically
|
143 |
+
linked subprograms that the work is specifically designed to require,
|
144 |
+
such as by intimate data communication or control flow between those
|
145 |
+
subprograms and other parts of the work.
|
146 |
+
|
147 |
+
The Corresponding Source need not include anything that users
|
148 |
+
can regenerate automatically from other parts of the Corresponding
|
149 |
+
Source.
|
150 |
+
|
151 |
+
The Corresponding Source for a work in source code form is that
|
152 |
+
same work.
|
153 |
+
|
154 |
+
2. Basic Permissions.
|
155 |
+
|
156 |
+
All rights granted under this License are granted for the term of
|
157 |
+
copyright on the Program, and are irrevocable provided the stated
|
158 |
+
conditions are met. This License explicitly affirms your unlimited
|
159 |
+
permission to run the unmodified Program. The output from running a
|
160 |
+
covered work is covered by this License only if the output, given its
|
161 |
+
content, constitutes a covered work. This License acknowledges your
|
162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
+
|
164 |
+
You may make, run and propagate covered works that you do not
|
165 |
+
convey, without conditions so long as your license otherwise remains
|
166 |
+
in force. You may convey covered works to others for the sole purpose
|
167 |
+
of having them make modifications exclusively for you, or provide you
|
168 |
+
with facilities for running those works, provided that you comply with
|
169 |
+
the terms of this License in conveying all material for which you do
|
170 |
+
not control copyright. Those thus making or running the covered works
|
171 |
+
for you must do so exclusively on your behalf, under your direction
|
172 |
+
and control, on terms that prohibit them from making any copies of
|
173 |
+
your copyrighted material outside their relationship with you.
|
174 |
+
|
175 |
+
Conveying under any other circumstances is permitted solely under
|
176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
+
makes it unnecessary.
|
178 |
+
|
179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
+
|
181 |
+
No covered work shall be deemed part of an effective technological
|
182 |
+
measure under any applicable law fulfilling obligations under article
|
183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
+
similar laws prohibiting or restricting circumvention of such
|
185 |
+
measures.
|
186 |
+
|
187 |
+
When you convey a covered work, you waive any legal power to forbid
|
188 |
+
circumvention of technological measures to the extent such circumvention
|
189 |
+
is effected by exercising rights under this License with respect to
|
190 |
+
the covered work, and you disclaim any intention to limit operation or
|
191 |
+
modification of the work as a means of enforcing, against the work's
|
192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
193 |
+
technological measures.
|
194 |
+
|
195 |
+
4. Conveying Verbatim Copies.
|
196 |
+
|
197 |
+
You may convey verbatim copies of the Program's source code as you
|
198 |
+
receive it, in any medium, provided that you conspicuously and
|
199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
200 |
+
keep intact all notices stating that this License and any
|
201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
+
keep intact all notices of the absence of any warranty; and give all
|
203 |
+
recipients a copy of this License along with the Program.
|
204 |
+
|
205 |
+
You may charge any price or no price for each copy that you convey,
|
206 |
+
and you may offer support or warranty protection for a fee.
|
207 |
+
|
208 |
+
5. Conveying Modified Source Versions.
|
209 |
+
|
210 |
+
You may convey a work based on the Program, or the modifications to
|
211 |
+
produce it from the Program, in the form of source code under the
|
212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
213 |
+
|
214 |
+
a) The work must carry prominent notices stating that you modified
|
215 |
+
it, and giving a relevant date.
|
216 |
+
|
217 |
+
b) The work must carry prominent notices stating that it is
|
218 |
+
released under this License and any conditions added under section
|
219 |
+
7. This requirement modifies the requirement in section 4 to
|
220 |
+
"keep intact all notices".
|
221 |
+
|
222 |
+
c) You must license the entire work, as a whole, under this
|
223 |
+
License to anyone who comes into possession of a copy. This
|
224 |
+
License will therefore apply, along with any applicable section 7
|
225 |
+
additional terms, to the whole of the work, and all its parts,
|
226 |
+
regardless of how they are packaged. This License gives no
|
227 |
+
permission to license the work in any other way, but it does not
|
228 |
+
invalidate such permission if you have separately received it.
|
229 |
+
|
230 |
+
d) If the work has interactive user interfaces, each must display
|
231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
233 |
+
work need not make them do so.
|
234 |
+
|
235 |
+
A compilation of a covered work with other separate and independent
|
236 |
+
works, which are not by their nature extensions of the covered work,
|
237 |
+
and which are not combined with it such as to form a larger program,
|
238 |
+
in or on a volume of a storage or distribution medium, is called an
|
239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
240 |
+
used to limit the access or legal rights of the compilation's users
|
241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
242 |
+
in an aggregate does not cause this License to apply to the other
|
243 |
+
parts of the aggregate.
|
244 |
+
|
245 |
+
6. Conveying Non-Source Forms.
|
246 |
+
|
247 |
+
You may convey a covered work in object code form under the terms
|
248 |
+
of sections 4 and 5, provided that you also convey the
|
249 |
+
machine-readable Corresponding Source under the terms of this License,
|
250 |
+
in one of these ways:
|
251 |
+
|
252 |
+
a) Convey the object code in, or embodied in, a physical product
|
253 |
+
(including a physical distribution medium), accompanied by the
|
254 |
+
Corresponding Source fixed on a durable physical medium
|
255 |
+
customarily used for software interchange.
|
256 |
+
|
257 |
+
b) Convey the object code in, or embodied in, a physical product
|
258 |
+
(including a physical distribution medium), accompanied by a
|
259 |
+
written offer, valid for at least three years and valid for as
|
260 |
+
long as you offer spare parts or customer support for that product
|
261 |
+
model, to give anyone who possesses the object code either (1) a
|
262 |
+
copy of the Corresponding Source for all the software in the
|
263 |
+
product that is covered by this License, on a durable physical
|
264 |
+
medium customarily used for software interchange, for a price no
|
265 |
+
more than your reasonable cost of physically performing this
|
266 |
+
conveying of source, or (2) access to copy the
|
267 |
+
Corresponding Source from a network server at no charge.
|
268 |
+
|
269 |
+
c) Convey individual copies of the object code with a copy of the
|
270 |
+
written offer to provide the Corresponding Source. This
|
271 |
+
alternative is allowed only occasionally and noncommercially, and
|
272 |
+
only if you received the object code with such an offer, in accord
|
273 |
+
with subsection 6b.
|
274 |
+
|
275 |
+
d) Convey the object code by offering access from a designated
|
276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
277 |
+
Corresponding Source in the same way through the same place at no
|
278 |
+
further charge. You need not require recipients to copy the
|
279 |
+
Corresponding Source along with the object code. If the place to
|
280 |
+
copy the object code is a network server, the Corresponding Source
|
281 |
+
may be on a different server (operated by you or a third party)
|
282 |
+
that supports equivalent copying facilities, provided you maintain
|
283 |
+
clear directions next to the object code saying where to find the
|
284 |
+
Corresponding Source. Regardless of what server hosts the
|
285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
286 |
+
available for as long as needed to satisfy these requirements.
|
287 |
+
|
288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
+
you inform other peers where the object code and Corresponding
|
290 |
+
Source of the work are being offered to the general public at no
|
291 |
+
charge under subsection 6d.
|
292 |
+
|
293 |
+
A separable portion of the object code, whose source code is excluded
|
294 |
+
from the Corresponding Source as a System Library, need not be
|
295 |
+
included in conveying the object code work.
|
296 |
+
|
297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
298 |
+
tangible personal property which is normally used for personal, family,
|
299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
+
product received by a particular user, "normally used" refers to a
|
303 |
+
typical or common use of that class of product, regardless of the status
|
304 |
+
of the particular user or of the way in which the particular user
|
305 |
+
actually uses, or expects or is expected to use, the product. A product
|
306 |
+
is a consumer product regardless of whether the product has substantial
|
307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
+
the only significant mode of use of the product.
|
309 |
+
|
310 |
+
"Installation Information" for a User Product means any methods,
|
311 |
+
procedures, authorization keys, or other information required to install
|
312 |
+
and execute modified versions of a covered work in that User Product from
|
313 |
+
a modified version of its Corresponding Source. The information must
|
314 |
+
suffice to ensure that the continued functioning of the modified object
|
315 |
+
code is in no case prevented or interfered with solely because
|
316 |
+
modification has been made.
|
317 |
+
|
318 |
+
If you convey an object code work under this section in, or with, or
|
319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
320 |
+
part of a transaction in which the right of possession and use of the
|
321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
322 |
+
fixed term (regardless of how the transaction is characterized), the
|
323 |
+
Corresponding Source conveyed under this section must be accompanied
|
324 |
+
by the Installation Information. But this requirement does not apply
|
325 |
+
if neither you nor any third party retains the ability to install
|
326 |
+
modified object code on the User Product (for example, the work has
|
327 |
+
been installed in ROM).
|
328 |
+
|
329 |
+
The requirement to provide Installation Information does not include a
|
330 |
+
requirement to continue to provide support service, warranty, or updates
|
331 |
+
for a work that has been modified or installed by the recipient, or for
|
332 |
+
the User Product in which it has been modified or installed. Access to a
|
333 |
+
network may be denied when the modification itself materially and
|
334 |
+
adversely affects the operation of the network or violates the rules and
|
335 |
+
protocols for communication across the network.
|
336 |
+
|
337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
338 |
+
in accord with this section must be in a format that is publicly
|
339 |
+
documented (and with an implementation available to the public in
|
340 |
+
source code form), and must require no special password or key for
|
341 |
+
unpacking, reading or copying.
|
342 |
+
|
343 |
+
7. Additional Terms.
|
344 |
+
|
345 |
+
"Additional permissions" are terms that supplement the terms of this
|
346 |
+
License by making exceptions from one or more of its conditions.
|
347 |
+
Additional permissions that are applicable to the entire Program shall
|
348 |
+
be treated as though they were included in this License, to the extent
|
349 |
+
that they are valid under applicable law. If additional permissions
|
350 |
+
apply only to part of the Program, that part may be used separately
|
351 |
+
under those permissions, but the entire Program remains governed by
|
352 |
+
this License without regard to the additional permissions.
|
353 |
+
|
354 |
+
When you convey a copy of a covered work, you may at your option
|
355 |
+
remove any additional permissions from that copy, or from any part of
|
356 |
+
it. (Additional permissions may be written to require their own
|
357 |
+
removal in certain cases when you modify the work.) You may place
|
358 |
+
additional permissions on material, added by you to a covered work,
|
359 |
+
for which you have or can give appropriate copyright permission.
|
360 |
+
|
361 |
+
Notwithstanding any other provision of this License, for material you
|
362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
+
that material) supplement the terms of this License with terms:
|
364 |
+
|
365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
366 |
+
terms of sections 15 and 16 of this License; or
|
367 |
+
|
368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
369 |
+
author attributions in that material or in the Appropriate Legal
|
370 |
+
Notices displayed by works containing it; or
|
371 |
+
|
372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
+
requiring that modified versions of such material be marked in
|
374 |
+
reasonable ways as different from the original version; or
|
375 |
+
|
376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
+
authors of the material; or
|
378 |
+
|
379 |
+
e) Declining to grant rights under trademark law for use of some
|
380 |
+
trade names, trademarks, or service marks; or
|
381 |
+
|
382 |
+
f) Requiring indemnification of licensors and authors of that
|
383 |
+
material by anyone who conveys the material (or modified versions of
|
384 |
+
it) with contractual assumptions of liability to the recipient, for
|
385 |
+
any liability that these contractual assumptions directly impose on
|
386 |
+
those licensors and authors.
|
387 |
+
|
388 |
+
All other non-permissive additional terms are considered "further
|
389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
390 |
+
received it, or any part of it, contains a notice stating that it is
|
391 |
+
governed by this License along with a term that is a further
|
392 |
+
restriction, you may remove that term. If a license document contains
|
393 |
+
a further restriction but permits relicensing or conveying under this
|
394 |
+
License, you may add to a covered work material governed by the terms
|
395 |
+
of that license document, provided that the further restriction does
|
396 |
+
not survive such relicensing or conveying.
|
397 |
+
|
398 |
+
If you add terms to a covered work in accord with this section, you
|
399 |
+
must place, in the relevant source files, a statement of the
|
400 |
+
additional terms that apply to those files, or a notice indicating
|
401 |
+
where to find the applicable terms.
|
402 |
+
|
403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
+
form of a separately written license, or stated as exceptions;
|
405 |
+
the above requirements apply either way.
|
406 |
+
|
407 |
+
8. Termination.
|
408 |
+
|
409 |
+
You may not propagate or modify a covered work except as expressly
|
410 |
+
provided under this License. Any attempt otherwise to propagate or
|
411 |
+
modify it is void, and will automatically terminate your rights under
|
412 |
+
this License (including any patent licenses granted under the third
|
413 |
+
paragraph of section 11).
|
414 |
+
|
415 |
+
However, if you cease all violation of this License, then your
|
416 |
+
license from a particular copyright holder is reinstated (a)
|
417 |
+
provisionally, unless and until the copyright holder explicitly and
|
418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
419 |
+
holder fails to notify you of the violation by some reasonable means
|
420 |
+
prior to 60 days after the cessation.
|
421 |
+
|
422 |
+
Moreover, your license from a particular copyright holder is
|
423 |
+
reinstated permanently if the copyright holder notifies you of the
|
424 |
+
violation by some reasonable means, this is the first time you have
|
425 |
+
received notice of violation of this License (for any work) from that
|
426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
427 |
+
your receipt of the notice.
|
428 |
+
|
429 |
+
Termination of your rights under this section does not terminate the
|
430 |
+
licenses of parties who have received copies or rights from you under
|
431 |
+
this License. If your rights have been terminated and not permanently
|
432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
433 |
+
material under section 10.
|
434 |
+
|
435 |
+
9. Acceptance Not Required for Having Copies.
|
436 |
+
|
437 |
+
You are not required to accept this License in order to receive or
|
438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
+
to receive a copy likewise does not require acceptance. However,
|
441 |
+
nothing other than this License grants you permission to propagate or
|
442 |
+
modify any covered work. These actions infringe copyright if you do
|
443 |
+
not accept this License. Therefore, by modifying or propagating a
|
444 |
+
covered work, you indicate your acceptance of this License to do so.
|
445 |
+
|
446 |
+
10. Automatic Licensing of Downstream Recipients.
|
447 |
+
|
448 |
+
Each time you convey a covered work, the recipient automatically
|
449 |
+
receives a license from the original licensors, to run, modify and
|
450 |
+
propagate that work, subject to this License. You are not responsible
|
451 |
+
for enforcing compliance by third parties with this License.
|
452 |
+
|
453 |
+
An "entity transaction" is a transaction transferring control of an
|
454 |
+
organization, or substantially all assets of one, or subdividing an
|
455 |
+
organization, or merging organizations. If propagation of a covered
|
456 |
+
work results from an entity transaction, each party to that
|
457 |
+
transaction who receives a copy of the work also receives whatever
|
458 |
+
licenses to the work the party's predecessor in interest had or could
|
459 |
+
give under the previous paragraph, plus a right to possession of the
|
460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
461 |
+
the predecessor has it or can get it with reasonable efforts.
|
462 |
+
|
463 |
+
You may not impose any further restrictions on the exercise of the
|
464 |
+
rights granted or affirmed under this License. For example, you may
|
465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
466 |
+
rights granted under this License, and you may not initiate litigation
|
467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
+
any patent claim is infringed by making, using, selling, offering for
|
469 |
+
sale, or importing the Program or any portion of it.
|
470 |
+
|
471 |
+
11. Patents.
|
472 |
+
|
473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
474 |
+
License of the Program or a work on which the Program is based. The
|
475 |
+
work thus licensed is called the contributor's "contributor version".
|
476 |
+
|
477 |
+
A contributor's "essential patent claims" are all patent claims
|
478 |
+
owned or controlled by the contributor, whether already acquired or
|
479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
+
by this License, of making, using, or selling its contributor version,
|
481 |
+
but do not include claims that would be infringed only as a
|
482 |
+
consequence of further modification of the contributor version. For
|
483 |
+
purposes of this definition, "control" includes the right to grant
|
484 |
+
patent sublicenses in a manner consistent with the requirements of
|
485 |
+
this License.
|
486 |
+
|
487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
+
patent license under the contributor's essential patent claims, to
|
489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
+
propagate the contents of its contributor version.
|
491 |
+
|
492 |
+
In the following three paragraphs, a "patent license" is any express
|
493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
494 |
+
(such as an express permission to practice a patent or covenant not to
|
495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
496 |
+
party means to make such an agreement or commitment not to enforce a
|
497 |
+
patent against the party.
|
498 |
+
|
499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
500 |
+
and the Corresponding Source of the work is not available for anyone
|
501 |
+
to copy, free of charge and under the terms of this License, through a
|
502 |
+
publicly available network server or other readily accessible means,
|
503 |
+
then you must either (1) cause the Corresponding Source to be so
|
504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
506 |
+
consistent with the requirements of this License, to extend the patent
|
507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
508 |
+
actual knowledge that, but for the patent license, your conveying the
|
509 |
+
covered work in a country, or your recipient's use of the covered work
|
510 |
+
in a country, would infringe one or more identifiable patents in that
|
511 |
+
country that you have reason to believe are valid.
|
512 |
+
|
513 |
+
If, pursuant to or in connection with a single transaction or
|
514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
+
covered work, and grant a patent license to some of the parties
|
516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
517 |
+
or convey a specific copy of the covered work, then the patent license
|
518 |
+
you grant is automatically extended to all recipients of the covered
|
519 |
+
work and works based on it.
|
520 |
+
|
521 |
+
A patent license is "discriminatory" if it does not include within
|
522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
524 |
+
specifically granted under this License. You may not convey a covered
|
525 |
+
work if you are a party to an arrangement with a third party that is
|
526 |
+
in the business of distributing software, under which you make payment
|
527 |
+
to the third party based on the extent of your activity of conveying
|
528 |
+
the work, and under which the third party grants, to any of the
|
529 |
+
parties who would receive the covered work from you, a discriminatory
|
530 |
+
patent license (a) in connection with copies of the covered work
|
531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
+
for and in connection with specific products or compilations that
|
533 |
+
contain the covered work, unless you entered into that arrangement,
|
534 |
+
or that patent license was granted, prior to 28 March 2007.
|
535 |
+
|
536 |
+
Nothing in this License shall be construed as excluding or limiting
|
537 |
+
any implied license or other defenses to infringement that may
|
538 |
+
otherwise be available to you under applicable patent law.
|
539 |
+
|
540 |
+
12. No Surrender of Others' Freedom.
|
541 |
+
|
542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
543 |
+
otherwise) that contradict the conditions of this License, they do not
|
544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
546 |
+
License and any other pertinent obligations, then as a consequence you may
|
547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
+
to collect a royalty for further conveying from those to whom you convey
|
549 |
+
the Program, the only way you could satisfy both those terms and this
|
550 |
+
License would be to refrain entirely from conveying the Program.
|
551 |
+
|
552 |
+
13. Use with the GNU Affero General Public License.
|
553 |
+
|
554 |
+
Notwithstanding any other provision of this License, you have
|
555 |
+
permission to link or combine any covered work with a work licensed
|
556 |
+
under version 3 of the GNU Affero General Public License into a single
|
557 |
+
combined work, and to convey the resulting work. The terms of this
|
558 |
+
License will continue to apply to the part which is the covered work,
|
559 |
+
but the special requirements of the GNU Affero General Public License,
|
560 |
+
section 13, concerning interaction through a network will apply to the
|
561 |
+
combination as such.
|
562 |
+
|
563 |
+
14. Revised Versions of this License.
|
564 |
+
|
565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
566 |
+
the GNU General Public License from time to time. Such new versions will
|
567 |
+
be similar in spirit to the present version, but may differ in detail to
|
568 |
+
address new problems or concerns.
|
569 |
+
|
570 |
+
Each version is given a distinguishing version number. If the
|
571 |
+
Program specifies that a certain numbered version of the GNU General
|
572 |
+
Public License "or any later version" applies to it, you have the
|
573 |
+
option of following the terms and conditions either of that numbered
|
574 |
+
version or of any later version published by the Free Software
|
575 |
+
Foundation. If the Program does not specify a version number of the
|
576 |
+
GNU General Public License, you may choose any version ever published
|
577 |
+
by the Free Software Foundation.
|
578 |
+
|
579 |
+
If the Program specifies that a proxy can decide which future
|
580 |
+
versions of the GNU General Public License can be used, that proxy's
|
581 |
+
public statement of acceptance of a version permanently authorizes you
|
582 |
+
to choose that version for the Program.
|
583 |
+
|
584 |
+
Later license versions may give you additional or different
|
585 |
+
permissions. However, no additional obligations are imposed on any
|
586 |
+
author or copyright holder as a result of your choosing to follow a
|
587 |
+
later version.
|
588 |
+
|
589 |
+
15. Disclaimer of Warranty.
|
590 |
+
|
591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
+
|
600 |
+
16. Limitation of Liability.
|
601 |
+
|
602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
+
SUCH DAMAGES.
|
611 |
+
|
612 |
+
17. Interpretation of Sections 15 and 16.
|
613 |
+
|
614 |
+
If the disclaimer of warranty and limitation of liability provided
|
615 |
+
above cannot be given local legal effect according to their terms,
|
616 |
+
reviewing courts shall apply local law that most closely approximates
|
617 |
+
an absolute waiver of all civil liability in connection with the
|
618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
619 |
+
copy of the Program in return for a fee.
|
620 |
+
|
621 |
+
END OF TERMS AND CONDITIONS
|
622 |
+
|
623 |
+
How to Apply These Terms to Your New Programs
|
624 |
+
|
625 |
+
If you develop a new program, and you want it to be of the greatest
|
626 |
+
possible use to the public, the best way to achieve this is to make it
|
627 |
+
free software which everyone can redistribute and change under these terms.
|
628 |
+
|
629 |
+
To do so, attach the following notices to the program. It is safest
|
630 |
+
to attach them to the start of each source file to most effectively
|
631 |
+
state the exclusion of warranty; and each file should have at least
|
632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
633 |
+
|
634 |
+
<one line to give the program's name and a brief idea of what it does.>
|
635 |
+
Copyright (C) <year> <name of author>
|
636 |
+
|
637 |
+
This program is free software: you can redistribute it and/or modify
|
638 |
+
it under the terms of the GNU General Public License as published by
|
639 |
+
the Free Software Foundation, either version 3 of the License, or
|
640 |
+
(at your option) any later version.
|
641 |
+
|
642 |
+
This program is distributed in the hope that it will be useful,
|
643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645 |
+
GNU General Public License for more details.
|
646 |
+
|
647 |
+
You should have received a copy of the GNU General Public License
|
648 |
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
649 |
+
|
650 |
+
Also add information on how to contact you by electronic and paper mail.
|
651 |
+
|
652 |
+
If the program does terminal interaction, make it output a short
|
653 |
+
notice like this when it starts in an interactive mode:
|
654 |
+
|
655 |
+
<program> Copyright (C) <year> <name of author>
|
656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
657 |
+
This is free software, and you are welcome to redistribute it
|
658 |
+
under certain conditions; type `show c' for details.
|
659 |
+
|
660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
661 |
+
parts of the General Public License. Of course, your program's commands
|
662 |
+
might be different; for a GUI interface, you would use an "about box".
|
663 |
+
|
664 |
+
You should also get your employer (if you work as a programmer) or school,
|
665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
667 |
+
<https://www.gnu.org/licenses/>.
|
668 |
+
|
669 |
+
The GNU General Public License does not permit incorporating your program
|
670 |
+
into proprietary programs. If your program is a subroutine library, you
|
671 |
+
may consider it more useful to permit linking proprietary applications with
|
672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
673 |
+
Public License instead of this License. But first, please read
|
674 |
+
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
bert_vits2/README.md
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Bert-VITS2
|
2 |
+
|
3 |
+
VITS2 Backbone with bert
|
4 |
+
## 成熟的旅行者/开拓者/舰长/博士/sensei/猎魔人/喵喵露/V应该参阅代码自己学习如何训练。
|
5 |
+
### 严禁将此项目用于一切违反《中华人民共和国宪法》,《中华人民共和国刑法》,《中华人民共和国治安管理处罚法》和《中华人民共和国民法典》之用途。
|
bert_vits2/__init__.py
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
from bert_vits2.bert_vits2 import Bert_VITS2
|
2 |
+
from bert_vits2 import text
|
bert_vits2/attentions.py
ADDED
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import math
|
2 |
+
import torch
|
3 |
+
from torch import nn
|
4 |
+
from torch.nn import functional as F
|
5 |
+
from bert_vits2 import commons
|
6 |
+
from torch.nn.utils import weight_norm, remove_weight_norm
|
7 |
+
|
8 |
+
|
9 |
+
class LayerNorm(nn.Module):
|
10 |
+
def __init__(self, channels, eps=1e-5):
|
11 |
+
super().__init__()
|
12 |
+
self.channels = channels
|
13 |
+
self.eps = eps
|
14 |
+
|
15 |
+
self.gamma = nn.Parameter(torch.ones(channels))
|
16 |
+
self.beta = nn.Parameter(torch.zeros(channels))
|
17 |
+
|
18 |
+
def forward(self, x):
|
19 |
+
x = x.transpose(1, -1)
|
20 |
+
x = F.layer_norm(x, (self.channels,), self.gamma, self.beta, self.eps)
|
21 |
+
return x.transpose(1, -1)
|
22 |
+
|
23 |
+
|
24 |
+
@torch.jit.script
|
25 |
+
def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels):
|
26 |
+
n_channels_int = n_channels[0]
|
27 |
+
in_act = input_a + input_b
|
28 |
+
t_act = torch.tanh(in_act[:, :n_channels_int, :])
|
29 |
+
s_act = torch.sigmoid(in_act[:, n_channels_int:, :])
|
30 |
+
acts = t_act * s_act
|
31 |
+
return acts
|
32 |
+
|
33 |
+
|
34 |
+
class Encoder(nn.Module):
|
35 |
+
def __init__(self, hidden_channels, filter_channels, n_heads, n_layers, kernel_size=1, p_dropout=0., window_size=4,
|
36 |
+
isflow=True, **kwargs):
|
37 |
+
super().__init__()
|
38 |
+
self.hidden_channels = hidden_channels
|
39 |
+
self.filter_channels = filter_channels
|
40 |
+
self.n_heads = n_heads
|
41 |
+
self.n_layers = n_layers
|
42 |
+
self.kernel_size = kernel_size
|
43 |
+
self.p_dropout = p_dropout
|
44 |
+
self.window_size = window_size
|
45 |
+
if isflow:
|
46 |
+
cond_layer = torch.nn.Conv1d(256, 2 * hidden_channels * n_layers, 1)
|
47 |
+
self.cond_pre = torch.nn.Conv1d(hidden_channels, 2 * hidden_channels, 1)
|
48 |
+
self.cond_layer = weight_norm(cond_layer, name='weight')
|
49 |
+
self.gin_channels = 256
|
50 |
+
self.cond_layer_idx = self.n_layers
|
51 |
+
if 'gin_channels' in kwargs:
|
52 |
+
self.gin_channels = kwargs['gin_channels']
|
53 |
+
if self.gin_channels != 0:
|
54 |
+
self.spk_emb_linear = nn.Linear(self.gin_channels, self.hidden_channels)
|
55 |
+
# vits2 says 3rd block, so idx is 2 by default
|
56 |
+
self.cond_layer_idx = kwargs['cond_layer_idx'] if 'cond_layer_idx' in kwargs else 2
|
57 |
+
# print(self.gin_channels, self.cond_layer_idx)
|
58 |
+
assert self.cond_layer_idx < self.n_layers, 'cond_layer_idx should be less than n_layers'
|
59 |
+
self.drop = nn.Dropout(p_dropout)
|
60 |
+
self.attn_layers = nn.ModuleList()
|
61 |
+
self.norm_layers_1 = nn.ModuleList()
|
62 |
+
self.ffn_layers = nn.ModuleList()
|
63 |
+
self.norm_layers_2 = nn.ModuleList()
|
64 |
+
for i in range(self.n_layers):
|
65 |
+
self.attn_layers.append(MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout,
|
66 |
+
window_size=window_size))
|
67 |
+
self.norm_layers_1.append(LayerNorm(hidden_channels))
|
68 |
+
self.ffn_layers.append(
|
69 |
+
FFN(hidden_channels, hidden_channels, filter_channels, kernel_size, p_dropout=p_dropout))
|
70 |
+
self.norm_layers_2.append(LayerNorm(hidden_channels))
|
71 |
+
|
72 |
+
def forward(self, x, x_mask, g=None):
|
73 |
+
attn_mask = x_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
|
74 |
+
x = x * x_mask
|
75 |
+
for i in range(self.n_layers):
|
76 |
+
if i == self.cond_layer_idx and g is not None:
|
77 |
+
g = self.spk_emb_linear(g.transpose(1, 2))
|
78 |
+
g = g.transpose(1, 2)
|
79 |
+
x = x + g
|
80 |
+
x = x * x_mask
|
81 |
+
y = self.attn_layers[i](x, x, attn_mask)
|
82 |
+
y = self.drop(y)
|
83 |
+
x = self.norm_layers_1[i](x + y)
|
84 |
+
|
85 |
+
y = self.ffn_layers[i](x, x_mask)
|
86 |
+
y = self.drop(y)
|
87 |
+
x = self.norm_layers_2[i](x + y)
|
88 |
+
x = x * x_mask
|
89 |
+
return x
|
90 |
+
|
91 |
+
|
92 |
+
class Decoder(nn.Module):
|
93 |
+
def __init__(self, hidden_channels, filter_channels, n_heads, n_layers, kernel_size=1, p_dropout=0.,
|
94 |
+
proximal_bias=False, proximal_init=True, **kwargs):
|
95 |
+
super().__init__()
|
96 |
+
self.hidden_channels = hidden_channels
|
97 |
+
self.filter_channels = filter_channels
|
98 |
+
self.n_heads = n_heads
|
99 |
+
self.n_layers = n_layers
|
100 |
+
self.kernel_size = kernel_size
|
101 |
+
self.p_dropout = p_dropout
|
102 |
+
self.proximal_bias = proximal_bias
|
103 |
+
self.proximal_init = proximal_init
|
104 |
+
|
105 |
+
self.drop = nn.Dropout(p_dropout)
|
106 |
+
self.self_attn_layers = nn.ModuleList()
|
107 |
+
self.norm_layers_0 = nn.ModuleList()
|
108 |
+
self.encdec_attn_layers = nn.ModuleList()
|
109 |
+
self.norm_layers_1 = nn.ModuleList()
|
110 |
+
self.ffn_layers = nn.ModuleList()
|
111 |
+
self.norm_layers_2 = nn.ModuleList()
|
112 |
+
for i in range(self.n_layers):
|
113 |
+
self.self_attn_layers.append(
|
114 |
+
MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout,
|
115 |
+
proximal_bias=proximal_bias, proximal_init=proximal_init))
|
116 |
+
self.norm_layers_0.append(LayerNorm(hidden_channels))
|
117 |
+
self.encdec_attn_layers.append(
|
118 |
+
MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout))
|
119 |
+
self.norm_layers_1.append(LayerNorm(hidden_channels))
|
120 |
+
self.ffn_layers.append(
|
121 |
+
FFN(hidden_channels, hidden_channels, filter_channels, kernel_size, p_dropout=p_dropout, causal=True))
|
122 |
+
self.norm_layers_2.append(LayerNorm(hidden_channels))
|
123 |
+
|
124 |
+
def forward(self, x, x_mask, h, h_mask):
|
125 |
+
"""
|
126 |
+
x: decoder input
|
127 |
+
h: encoder output
|
128 |
+
"""
|
129 |
+
self_attn_mask = commons.subsequent_mask(x_mask.size(2)).to(device=x.device, dtype=x.dtype)
|
130 |
+
encdec_attn_mask = h_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
|
131 |
+
x = x * x_mask
|
132 |
+
for i in range(self.n_layers):
|
133 |
+
y = self.self_attn_layers[i](x, x, self_attn_mask)
|
134 |
+
y = self.drop(y)
|
135 |
+
x = self.norm_layers_0[i](x + y)
|
136 |
+
|
137 |
+
y = self.encdec_attn_layers[i](x, h, encdec_attn_mask)
|
138 |
+
y = self.drop(y)
|
139 |
+
x = self.norm_layers_1[i](x + y)
|
140 |
+
|
141 |
+
y = self.ffn_layers[i](x, x_mask)
|
142 |
+
y = self.drop(y)
|
143 |
+
x = self.norm_layers_2[i](x + y)
|
144 |
+
x = x * x_mask
|
145 |
+
return x
|
146 |
+
|
147 |
+
|
148 |
+
class MultiHeadAttention(nn.Module):
|
149 |
+
def __init__(self, channels, out_channels, n_heads, p_dropout=0., window_size=None, heads_share=True,
|
150 |
+
block_length=None, proximal_bias=False, proximal_init=False):
|
151 |
+
super().__init__()
|
152 |
+
assert channels % n_heads == 0
|
153 |
+
|
154 |
+
self.channels = channels
|
155 |
+
self.out_channels = out_channels
|
156 |
+
self.n_heads = n_heads
|
157 |
+
self.p_dropout = p_dropout
|
158 |
+
self.window_size = window_size
|
159 |
+
self.heads_share = heads_share
|
160 |
+
self.block_length = block_length
|
161 |
+
self.proximal_bias = proximal_bias
|
162 |
+
self.proximal_init = proximal_init
|
163 |
+
self.attn = None
|
164 |
+
|
165 |
+
self.k_channels = channels // n_heads
|
166 |
+
self.conv_q = nn.Conv1d(channels, channels, 1)
|
167 |
+
self.conv_k = nn.Conv1d(channels, channels, 1)
|
168 |
+
self.conv_v = nn.Conv1d(channels, channels, 1)
|
169 |
+
self.conv_o = nn.Conv1d(channels, out_channels, 1)
|
170 |
+
self.drop = nn.Dropout(p_dropout)
|
171 |
+
|
172 |
+
if window_size is not None:
|
173 |
+
n_heads_rel = 1 if heads_share else n_heads
|
174 |
+
rel_stddev = self.k_channels ** -0.5
|
175 |
+
self.emb_rel_k = nn.Parameter(torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels) * rel_stddev)
|
176 |
+
self.emb_rel_v = nn.Parameter(torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels) * rel_stddev)
|
177 |
+
|
178 |
+
nn.init.xavier_uniform_(self.conv_q.weight)
|
179 |
+
nn.init.xavier_uniform_(self.conv_k.weight)
|
180 |
+
nn.init.xavier_uniform_(self.conv_v.weight)
|
181 |
+
if proximal_init:
|
182 |
+
with torch.no_grad():
|
183 |
+
self.conv_k.weight.copy_(self.conv_q.weight)
|
184 |
+
self.conv_k.bias.copy_(self.conv_q.bias)
|
185 |
+
|
186 |
+
def forward(self, x, c, attn_mask=None):
|
187 |
+
q = self.conv_q(x)
|
188 |
+
k = self.conv_k(c)
|
189 |
+
v = self.conv_v(c)
|
190 |
+
|
191 |
+
x, self.attn = self.attention(q, k, v, mask=attn_mask)
|
192 |
+
|
193 |
+
x = self.conv_o(x)
|
194 |
+
return x
|
195 |
+
|
196 |
+
def attention(self, query, key, value, mask=None):
|
197 |
+
# reshape [b, d, t] -> [b, n_h, t, d_k]
|
198 |
+
b, d, t_s, t_t = (*key.size(), query.size(2))
|
199 |
+
query = query.view(b, self.n_heads, self.k_channels, t_t).transpose(2, 3)
|
200 |
+
key = key.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
|
201 |
+
value = value.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
|
202 |
+
|
203 |
+
scores = torch.matmul(query / math.sqrt(self.k_channels), key.transpose(-2, -1))
|
204 |
+
if self.window_size is not None:
|
205 |
+
assert t_s == t_t, "Relative attention is only available for self-attention."
|
206 |
+
key_relative_embeddings = self._get_relative_embeddings(self.emb_rel_k, t_s)
|
207 |
+
rel_logits = self._matmul_with_relative_keys(query / math.sqrt(self.k_channels), key_relative_embeddings)
|
208 |
+
scores_local = self._relative_position_to_absolute_position(rel_logits)
|
209 |
+
scores = scores + scores_local
|
210 |
+
if self.proximal_bias:
|
211 |
+
assert t_s == t_t, "Proximal bias is only available for self-attention."
|
212 |
+
scores = scores + self._attention_bias_proximal(t_s).to(device=scores.device, dtype=scores.dtype)
|
213 |
+
if mask is not None:
|
214 |
+
scores = scores.masked_fill(mask == 0, -1e4)
|
215 |
+
if self.block_length is not None:
|
216 |
+
assert t_s == t_t, "Local attention is only available for self-attention."
|
217 |
+
block_mask = torch.ones_like(scores).triu(-self.block_length).tril(self.block_length)
|
218 |
+
scores = scores.masked_fill(block_mask == 0, -1e4)
|
219 |
+
p_attn = F.softmax(scores, dim=-1) # [b, n_h, t_t, t_s]
|
220 |
+
p_attn = self.drop(p_attn)
|
221 |
+
output = torch.matmul(p_attn, value)
|
222 |
+
if self.window_size is not None:
|
223 |
+
relative_weights = self._absolute_position_to_relative_position(p_attn)
|
224 |
+
value_relative_embeddings = self._get_relative_embeddings(self.emb_rel_v, t_s)
|
225 |
+
output = output + self._matmul_with_relative_values(relative_weights, value_relative_embeddings)
|
226 |
+
output = output.transpose(2, 3).contiguous().view(b, d, t_t) # [b, n_h, t_t, d_k] -> [b, d, t_t]
|
227 |
+
return output, p_attn
|
228 |
+
|
229 |
+
def _matmul_with_relative_values(self, x, y):
|
230 |
+
"""
|
231 |
+
x: [b, h, l, m]
|
232 |
+
y: [h or 1, m, d]
|
233 |
+
ret: [b, h, l, d]
|
234 |
+
"""
|
235 |
+
ret = torch.matmul(x, y.unsqueeze(0))
|
236 |
+
return ret
|
237 |
+
|
238 |
+
def _matmul_with_relative_keys(self, x, y):
|
239 |
+
"""
|
240 |
+
x: [b, h, l, d]
|
241 |
+
y: [h or 1, m, d]
|
242 |
+
ret: [b, h, l, m]
|
243 |
+
"""
|
244 |
+
ret = torch.matmul(x, y.unsqueeze(0).transpose(-2, -1))
|
245 |
+
return ret
|
246 |
+
|
247 |
+
def _get_relative_embeddings(self, relative_embeddings, length):
|
248 |
+
max_relative_position = 2 * self.window_size + 1
|
249 |
+
# Pad first before slice to avoid using cond ops.
|
250 |
+
pad_length = max(length - (self.window_size + 1), 0)
|
251 |
+
slice_start_position = max((self.window_size + 1) - length, 0)
|
252 |
+
slice_end_position = slice_start_position + 2 * length - 1
|
253 |
+
if pad_length > 0:
|
254 |
+
padded_relative_embeddings = F.pad(
|
255 |
+
relative_embeddings,
|
256 |
+
commons.convert_pad_shape([[0, 0], [pad_length, pad_length], [0, 0]]))
|
257 |
+
else:
|
258 |
+
padded_relative_embeddings = relative_embeddings
|
259 |
+
used_relative_embeddings = padded_relative_embeddings[:, slice_start_position:slice_end_position]
|
260 |
+
return used_relative_embeddings
|
261 |
+
|
262 |
+
def _relative_position_to_absolute_position(self, x):
|
263 |
+
"""
|
264 |
+
x: [b, h, l, 2*l-1]
|
265 |
+
ret: [b, h, l, l]
|
266 |
+
"""
|
267 |
+
batch, heads, length, _ = x.size()
|
268 |
+
# Concat columns of pad to shift from relative to absolute indexing.
|
269 |
+
x = F.pad(x, commons.convert_pad_shape([[0, 0], [0, 0], [0, 0], [0, 1]]))
|
270 |
+
|
271 |
+
# Concat extra elements so to add up to shape (len+1, 2*len-1).
|
272 |
+
x_flat = x.view([batch, heads, length * 2 * length])
|
273 |
+
x_flat = F.pad(x_flat, commons.convert_pad_shape([[0, 0], [0, 0], [0, length - 1]]))
|
274 |
+
|
275 |
+
# Reshape and slice out the padded elements.
|
276 |
+
x_final = x_flat.view([batch, heads, length + 1, 2 * length - 1])[:, :, :length, length - 1:]
|
277 |
+
return x_final
|
278 |
+
|
279 |
+
def _absolute_position_to_relative_position(self, x):
|
280 |
+
"""
|
281 |
+
x: [b, h, l, l]
|
282 |
+
ret: [b, h, l, 2*l-1]
|
283 |
+
"""
|
284 |
+
batch, heads, length, _ = x.size()
|
285 |
+
# padd along column
|
286 |
+
x = F.pad(x, commons.convert_pad_shape([[0, 0], [0, 0], [0, 0], [0, length - 1]]))
|
287 |
+
x_flat = x.view([batch, heads, length ** 2 + length * (length - 1)])
|
288 |
+
# add 0's in the beginning that will skew the elements after reshape
|
289 |
+
x_flat = F.pad(x_flat, commons.convert_pad_shape([[0, 0], [0, 0], [length, 0]]))
|
290 |
+
x_final = x_flat.view([batch, heads, length, 2 * length])[:, :, :, 1:]
|
291 |
+
return x_final
|
292 |
+
|
293 |
+
def _attention_bias_proximal(self, length):
|
294 |
+
"""Bias for self-attention to encourage attention to close positions.
|
295 |
+
Args:
|
296 |
+
length: an integer scalar.
|
297 |
+
Returns:
|
298 |
+
a Tensor with shape [1, 1, length, length]
|
299 |
+
"""
|
300 |
+
r = torch.arange(length, dtype=torch.float32)
|
301 |
+
diff = torch.unsqueeze(r, 0) - torch.unsqueeze(r, 1)
|
302 |
+
return torch.unsqueeze(torch.unsqueeze(-torch.log1p(torch.abs(diff)), 0), 0)
|
303 |
+
|
304 |
+
|
305 |
+
class FFN(nn.Module):
|
306 |
+
def __init__(self, in_channels, out_channels, filter_channels, kernel_size, p_dropout=0., activation=None,
|
307 |
+
causal=False):
|
308 |
+
super().__init__()
|
309 |
+
self.in_channels = in_channels
|
310 |
+
self.out_channels = out_channels
|
311 |
+
self.filter_channels = filter_channels
|
312 |
+
self.kernel_size = kernel_size
|
313 |
+
self.p_dropout = p_dropout
|
314 |
+
self.activation = activation
|
315 |
+
self.causal = causal
|
316 |
+
|
317 |
+
if causal:
|
318 |
+
self.padding = self._causal_padding
|
319 |
+
else:
|
320 |
+
self.padding = self._same_padding
|
321 |
+
|
322 |
+
self.conv_1 = nn.Conv1d(in_channels, filter_channels, kernel_size)
|
323 |
+
self.conv_2 = nn.Conv1d(filter_channels, out_channels, kernel_size)
|
324 |
+
self.drop = nn.Dropout(p_dropout)
|
325 |
+
|
326 |
+
def forward(self, x, x_mask):
|
327 |
+
x = self.conv_1(self.padding(x * x_mask))
|
328 |
+
if self.activation == "gelu":
|
329 |
+
x = x * torch.sigmoid(1.702 * x)
|
330 |
+
else:
|
331 |
+
x = torch.relu(x)
|
332 |
+
x = self.drop(x)
|
333 |
+
x = self.conv_2(self.padding(x * x_mask))
|
334 |
+
return x * x_mask
|
335 |
+
|
336 |
+
def _causal_padding(self, x):
|
337 |
+
if self.kernel_size == 1:
|
338 |
+
return x
|
339 |
+
pad_l = self.kernel_size - 1
|
340 |
+
pad_r = 0
|
341 |
+
padding = [[0, 0], [0, 0], [pad_l, pad_r]]
|
342 |
+
x = F.pad(x, commons.convert_pad_shape(padding))
|
343 |
+
return x
|
344 |
+
|
345 |
+
def _same_padding(self, x):
|
346 |
+
if self.kernel_size == 1:
|
347 |
+
return x
|
348 |
+
pad_l = (self.kernel_size - 1) // 2
|
349 |
+
pad_r = self.kernel_size // 2
|
350 |
+
padding = [[0, 0], [0, 0], [pad_l, pad_r]]
|
351 |
+
x = F.pad(x, commons.convert_pad_shape(padding))
|
352 |
+
return x
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/.gitattributes
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- zh
|
4 |
+
tags:
|
5 |
+
- bert
|
6 |
+
license: "apache-2.0"
|
7 |
+
---
|
8 |
+
|
9 |
+
# Please use 'Bert' related functions to load this model!
|
10 |
+
|
11 |
+
## Chinese BERT with Whole Word Masking
|
12 |
+
For further accelerating Chinese natural language processing, we provide **Chinese pre-trained BERT with Whole Word Masking**.
|
13 |
+
|
14 |
+
**[Pre-Training with Whole Word Masking for Chinese BERT](https://arxiv.org/abs/1906.08101)**
|
15 |
+
Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, Ziqing Yang, Shijin Wang, Guoping Hu
|
16 |
+
|
17 |
+
This repository is developed based on:https://github.com/google-research/bert
|
18 |
+
|
19 |
+
You may also interested in,
|
20 |
+
- Chinese BERT series: https://github.com/ymcui/Chinese-BERT-wwm
|
21 |
+
- Chinese MacBERT: https://github.com/ymcui/MacBERT
|
22 |
+
- Chinese ELECTRA: https://github.com/ymcui/Chinese-ELECTRA
|
23 |
+
- Chinese XLNet: https://github.com/ymcui/Chinese-XLNet
|
24 |
+
- Knowledge Distillation Toolkit - TextBrewer: https://github.com/airaria/TextBrewer
|
25 |
+
|
26 |
+
More resources by HFL: https://github.com/ymcui/HFL-Anthology
|
27 |
+
|
28 |
+
## Citation
|
29 |
+
If you find the technical report or resource is useful, please cite the following technical report in your paper.
|
30 |
+
- Primary: https://arxiv.org/abs/2004.13922
|
31 |
+
```
|
32 |
+
@inproceedings{cui-etal-2020-revisiting,
|
33 |
+
title = "Revisiting Pre-Trained Models for {C}hinese Natural Language Processing",
|
34 |
+
author = "Cui, Yiming and
|
35 |
+
Che, Wanxiang and
|
36 |
+
Liu, Ting and
|
37 |
+
Qin, Bing and
|
38 |
+
Wang, Shijin and
|
39 |
+
Hu, Guoping",
|
40 |
+
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings",
|
41 |
+
month = nov,
|
42 |
+
year = "2020",
|
43 |
+
address = "Online",
|
44 |
+
publisher = "Association for Computational Linguistics",
|
45 |
+
url = "https://www.aclweb.org/anthology/2020.findings-emnlp.58",
|
46 |
+
pages = "657--668",
|
47 |
+
}
|
48 |
+
```
|
49 |
+
- Secondary: https://arxiv.org/abs/1906.08101
|
50 |
+
```
|
51 |
+
@article{chinese-bert-wwm,
|
52 |
+
title={Pre-Training with Whole Word Masking for Chinese BERT},
|
53 |
+
author={Cui, Yiming and Che, Wanxiang and Liu, Ting and Qin, Bing and Yang, Ziqing and Wang, Shijin and Hu, Guoping},
|
54 |
+
journal={arXiv preprint arXiv:1906.08101},
|
55 |
+
year={2019}
|
56 |
+
}
|
57 |
+
```
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/added_tokens.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{}
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertForMaskedLM"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"bos_token_id": 0,
|
7 |
+
"directionality": "bidi",
|
8 |
+
"eos_token_id": 2,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 1024,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 4096,
|
14 |
+
"layer_norm_eps": 1e-12,
|
15 |
+
"max_position_embeddings": 512,
|
16 |
+
"model_type": "bert",
|
17 |
+
"num_attention_heads": 16,
|
18 |
+
"num_hidden_layers": 24,
|
19 |
+
"output_past": true,
|
20 |
+
"pad_token_id": 0,
|
21 |
+
"pooler_fc_size": 768,
|
22 |
+
"pooler_num_attention_heads": 12,
|
23 |
+
"pooler_num_fc_layers": 3,
|
24 |
+
"pooler_size_per_head": 128,
|
25 |
+
"pooler_type": "first_token_transform",
|
26 |
+
"type_vocab_size": 2,
|
27 |
+
"vocab_size": 21128
|
28 |
+
}
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/flax_model.msgpack
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a46a510fe646213c728b80c9d0d5691d05235523d67f9ac3c3ce4e67deabf926
|
3 |
+
size 1302196529
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4ac62d49144d770c5ca9a5d1d3039c4995665a080febe63198189857c6bd11cd
|
3 |
+
size 1306484351
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/tf_model.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:72d18616fb285b720cb869c25aa9f4d7371033dfd5d8ba82aca448fdd28132bf
|
3 |
+
size 1302594480
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"init_inputs": []}
|
bert_vits2/bert/chinese-roberta-wwm-ext-large/vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
bert_vits2/bert_vits2.py
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import torch
|
3 |
+
|
4 |
+
from bert_vits2 import utils, commons
|
5 |
+
from bert_vits2.models import SynthesizerTrn
|
6 |
+
from bert_vits2.text import symbols, cleaned_text_to_sequence, get_bert
|
7 |
+
from bert_vits2.text.cleaner import clean_text
|
8 |
+
from utils.nlp import sentence_split, cut
|
9 |
+
|
10 |
+
|
11 |
+
class Bert_VITS2:
|
12 |
+
def __init__(self, model, config, device=torch.device("cpu")):
|
13 |
+
self.hps_ms = utils.get_hparams_from_file(config)
|
14 |
+
self.n_speakers = getattr(self.hps_ms.data, 'n_speakers', 0)
|
15 |
+
self.speakers = [item[0] for item in
|
16 |
+
sorted(list(getattr(self.hps_ms.data, 'spk2id', {'0': 0}).items()), key=lambda x: x[1])]
|
17 |
+
self.net_g = SynthesizerTrn(
|
18 |
+
len(symbols),
|
19 |
+
self.hps_ms.data.filter_length // 2 + 1,
|
20 |
+
self.hps_ms.train.segment_size // self.hps_ms.data.hop_length,
|
21 |
+
n_speakers=self.hps_ms.data.n_speakers,
|
22 |
+
**self.hps_ms.model).to(device)
|
23 |
+
_ = self.net_g.eval()
|
24 |
+
self.device = device
|
25 |
+
self.load_model(model)
|
26 |
+
|
27 |
+
def load_model(self, model):
|
28 |
+
utils.load_checkpoint(model, self.net_g, None, skip_optimizer=True)
|
29 |
+
|
30 |
+
def get_speakers(self):
|
31 |
+
return self.speakers
|
32 |
+
|
33 |
+
def get_text(self, text, language_str, hps):
|
34 |
+
norm_text, phone, tone, word2ph = clean_text(text, language_str)
|
35 |
+
# print([f"{p}{t}" for p, t in zip(phone, tone)])
|
36 |
+
phone, tone, language = cleaned_text_to_sequence(phone, tone, language_str)
|
37 |
+
|
38 |
+
if hps.data.add_blank:
|
39 |
+
phone = commons.intersperse(phone, 0)
|
40 |
+
tone = commons.intersperse(tone, 0)
|
41 |
+
language = commons.intersperse(language, 0)
|
42 |
+
for i in range(len(word2ph)):
|
43 |
+
word2ph[i] = word2ph[i] * 2
|
44 |
+
word2ph[0] += 1
|
45 |
+
bert = get_bert(norm_text, word2ph, language_str)
|
46 |
+
|
47 |
+
assert bert.shape[-1] == len(phone)
|
48 |
+
|
49 |
+
phone = torch.LongTensor(phone)
|
50 |
+
tone = torch.LongTensor(tone)
|
51 |
+
language = torch.LongTensor(language)
|
52 |
+
|
53 |
+
return bert, phone, tone, language
|
54 |
+
|
55 |
+
def infer(self, text, sdp_ratio, noise_scale, noise_scale_w, length_scale, sid):
|
56 |
+
bert, phones, tones, lang_ids = self.get_text(text, "ZH", self.hps_ms)
|
57 |
+
with torch.no_grad():
|
58 |
+
x_tst = phones.to(self.device).unsqueeze(0)
|
59 |
+
tones = tones.to(self.device).unsqueeze(0)
|
60 |
+
lang_ids = lang_ids.to(self.device).unsqueeze(0)
|
61 |
+
bert = bert.to(self.device).unsqueeze(0)
|
62 |
+
x_tst_lengths = torch.LongTensor([phones.size(0)]).to(self.device)
|
63 |
+
speakers = torch.LongTensor([int(sid)]).to(self.device)
|
64 |
+
audio = self.net_g.infer(x_tst, x_tst_lengths, speakers, tones, lang_ids, bert, sdp_ratio=sdp_ratio
|
65 |
+
, noise_scale=noise_scale, noise_scale_w=noise_scale_w, length_scale=length_scale)[
|
66 |
+
0][0, 0].data.cpu().float().numpy()
|
67 |
+
|
68 |
+
torch.cuda.empty_cache()
|
69 |
+
return audio
|
70 |
+
|
71 |
+
def get_audio(self, voice, auto_break=False):
|
72 |
+
text = voice.get("text", None)
|
73 |
+
sdp_ratio = voice.get("sdp_ratio", 0.2)
|
74 |
+
noise_scale = voice.get("noise", 0.5)
|
75 |
+
noise_scale_w = voice.get("noisew", 0.6)
|
76 |
+
length_scale = voice.get("length", 1)
|
77 |
+
sid = voice.get("id", 0)
|
78 |
+
max = voice.get("max", 50)
|
79 |
+
# sentence_list = sentence_split(text, max, "ZH", ["zh"])
|
80 |
+
sentence_list = cut(text, max)
|
81 |
+
audios = []
|
82 |
+
for sentence in sentence_list:
|
83 |
+
audio = self.infer(sentence, sdp_ratio, noise_scale, noise_scale_w, length_scale, sid)
|
84 |
+
audios.append(audio)
|
85 |
+
audio = np.concatenate(audios)
|
86 |
+
return audio
|
bert_vits2/commons.py
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import math
|
2 |
+
import numpy as np
|
3 |
+
import torch
|
4 |
+
from torch import nn
|
5 |
+
from torch.nn import functional as F
|
6 |
+
|
7 |
+
|
8 |
+
def init_weights(m, mean=0.0, std=0.01):
|
9 |
+
classname = m.__class__.__name__
|
10 |
+
if classname.find("Conv") != -1:
|
11 |
+
m.weight.data.normal_(mean, std)
|
12 |
+
|
13 |
+
|
14 |
+
def get_padding(kernel_size, dilation=1):
|
15 |
+
return int((kernel_size * dilation - dilation) / 2)
|
16 |
+
|
17 |
+
|
18 |
+
def convert_pad_shape(pad_shape):
|
19 |
+
l = pad_shape[::-1]
|
20 |
+
pad_shape = [item for sublist in l for item in sublist]
|
21 |
+
return pad_shape
|
22 |
+
|
23 |
+
|
24 |
+
def intersperse(lst, item):
|
25 |
+
result = [item] * (len(lst) * 2 + 1)
|
26 |
+
result[1::2] = lst
|
27 |
+
return result
|
28 |
+
|
29 |
+
|
30 |
+
def kl_divergence(m_p, logs_p, m_q, logs_q):
|
31 |
+
"""KL(P||Q)"""
|
32 |
+
kl = (logs_q - logs_p) - 0.5
|
33 |
+
kl += 0.5 * (torch.exp(2. * logs_p) + ((m_p - m_q) ** 2)) * torch.exp(-2. * logs_q)
|
34 |
+
return kl
|
35 |
+
|
36 |
+
|
37 |
+
def rand_gumbel(shape):
|
38 |
+
"""Sample from the Gumbel distribution, protect from overflows."""
|
39 |
+
uniform_samples = torch.rand(shape) * 0.99998 + 0.00001
|
40 |
+
return -torch.log(-torch.log(uniform_samples))
|
41 |
+
|
42 |
+
|
43 |
+
def rand_gumbel_like(x):
|
44 |
+
g = rand_gumbel(x.size()).to(dtype=x.dtype, device=x.device)
|
45 |
+
return g
|
46 |
+
|
47 |
+
|
48 |
+
def slice_segments(x, ids_str, segment_size=4):
|
49 |
+
ret = torch.zeros_like(x[:, :, :segment_size])
|
50 |
+
for i in range(x.size(0)):
|
51 |
+
idx_str = ids_str[i]
|
52 |
+
idx_end = idx_str + segment_size
|
53 |
+
ret[i] = x[i, :, idx_str:idx_end]
|
54 |
+
return ret
|
55 |
+
|
56 |
+
|
57 |
+
def rand_slice_segments(x, x_lengths=None, segment_size=4):
|
58 |
+
b, d, t = x.size()
|
59 |
+
if x_lengths is None:
|
60 |
+
x_lengths = t
|
61 |
+
ids_str_max = x_lengths - segment_size + 1
|
62 |
+
ids_str = (torch.rand([b]).to(device=x.device) * ids_str_max).to(dtype=torch.long)
|
63 |
+
ret = slice_segments(x, ids_str, segment_size)
|
64 |
+
return ret, ids_str
|
65 |
+
|
66 |
+
|
67 |
+
def get_timing_signal_1d(
|
68 |
+
length, channels, min_timescale=1.0, max_timescale=1.0e4):
|
69 |
+
position = torch.arange(length, dtype=torch.float)
|
70 |
+
num_timescales = channels // 2
|
71 |
+
log_timescale_increment = (
|
72 |
+
math.log(float(max_timescale) / float(min_timescale)) /
|
73 |
+
(num_timescales - 1))
|
74 |
+
inv_timescales = min_timescale * torch.exp(
|
75 |
+
torch.arange(num_timescales, dtype=torch.float) * -log_timescale_increment)
|
76 |
+
scaled_time = position.unsqueeze(0) * inv_timescales.unsqueeze(1)
|
77 |
+
signal = torch.cat([torch.sin(scaled_time), torch.cos(scaled_time)], 0)
|
78 |
+
signal = F.pad(signal, [0, 0, 0, channels % 2])
|
79 |
+
signal = signal.view(1, channels, length)
|
80 |
+
return signal
|
81 |
+
|
82 |
+
|
83 |
+
def add_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4):
|
84 |
+
b, channels, length = x.size()
|
85 |
+
signal = get_timing_signal_1d(length, channels, min_timescale, max_timescale)
|
86 |
+
return x + signal.to(dtype=x.dtype, device=x.device)
|
87 |
+
|
88 |
+
|
89 |
+
def cat_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4, axis=1):
|
90 |
+
b, channels, length = x.size()
|
91 |
+
signal = get_timing_signal_1d(length, channels, min_timescale, max_timescale)
|
92 |
+
return torch.cat([x, signal.to(dtype=x.dtype, device=x.device)], axis)
|
93 |
+
|
94 |
+
|
95 |
+
def subsequent_mask(length):
|
96 |
+
mask = torch.tril(torch.ones(length, length)).unsqueeze(0).unsqueeze(0)
|
97 |
+
return mask
|
98 |
+
|
99 |
+
|
100 |
+
@torch.jit.script
|
101 |
+
def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels):
|
102 |
+
n_channels_int = n_channels[0]
|
103 |
+
in_act = input_a + input_b
|
104 |
+
t_act = torch.tanh(in_act[:, :n_channels_int, :])
|
105 |
+
s_act = torch.sigmoid(in_act[:, n_channels_int:, :])
|
106 |
+
acts = t_act * s_act
|
107 |
+
return acts
|
108 |
+
|
109 |
+
|
110 |
+
def convert_pad_shape(pad_shape):
|
111 |
+
l = pad_shape[::-1]
|
112 |
+
pad_shape = [item for sublist in l for item in sublist]
|
113 |
+
return pad_shape
|
114 |
+
|
115 |
+
|
116 |
+
def shift_1d(x):
|
117 |
+
x = F.pad(x, convert_pad_shape([[0, 0], [0, 0], [1, 0]]))[:, :, :-1]
|
118 |
+
return x
|
119 |
+
|
120 |
+
|
121 |
+
def sequence_mask(length, max_length=None):
|
122 |
+
if max_length is None:
|
123 |
+
max_length = length.max()
|
124 |
+
x = torch.arange(max_length, dtype=length.dtype, device=length.device)
|
125 |
+
return x.unsqueeze(0) < length.unsqueeze(1)
|
126 |
+
|
127 |
+
|
128 |
+
def generate_path(duration, mask):
|
129 |
+
"""
|
130 |
+
duration: [b, 1, t_x]
|
131 |
+
mask: [b, 1, t_y, t_x]
|
132 |
+
"""
|
133 |
+
device = duration.device
|
134 |
+
|
135 |
+
b, _, t_y, t_x = mask.shape
|
136 |
+
cum_duration = torch.cumsum(duration, -1)
|
137 |
+
|
138 |
+
cum_duration_flat = cum_duration.view(b * t_x)
|
139 |
+
path = sequence_mask(cum_duration_flat, t_y).to(mask.dtype)
|
140 |
+
path = path.view(b, t_x, t_y)
|
141 |
+
path = path - F.pad(path, convert_pad_shape([[0, 0], [1, 0], [0, 0]]))[:, :-1]
|
142 |
+
path = path.unsqueeze(1).transpose(2, 3) * mask
|
143 |
+
return path
|
144 |
+
|
145 |
+
|
146 |
+
def clip_grad_value_(parameters, clip_value, norm_type=2):
|
147 |
+
if isinstance(parameters, torch.Tensor):
|
148 |
+
parameters = [parameters]
|
149 |
+
parameters = list(filter(lambda p: p.grad is not None, parameters))
|
150 |
+
norm_type = float(norm_type)
|
151 |
+
if clip_value is not None:
|
152 |
+
clip_value = float(clip_value)
|
153 |
+
|
154 |
+
total_norm = 0
|
155 |
+
for p in parameters:
|
156 |
+
param_norm = p.grad.data.norm(norm_type)
|
157 |
+
total_norm += param_norm.item() ** norm_type
|
158 |
+
if clip_value is not None:
|
159 |
+
p.grad.data.clamp_(min=-clip_value, max=clip_value)
|
160 |
+
total_norm = total_norm ** (1. / norm_type)
|
161 |
+
return total_norm
|