|
# ์๊ฐ |
|
|
|
<div> |
|
<a target="_blank" href="https://discord.gg/Es5qTB9BcN"> |
|
<img alt="Discord" src="https://img.shields.io/discord/1214047546020728892?color=%23738ADB&label=Discord&logo=discord&logoColor=white&style=flat-square"/> |
|
</a> |
|
<a target="_blank" href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=jCKlUP7QgSm9kh95UlBoYv6s1I-Apl1M&authKey=xI5ttVAp3do68IpEYEalwXSYZFdfxZSkah%2BctF5FIMyN2NqAa003vFtLqJyAVRfF&noverify=0&group_code=593946093"> |
|
<img alt="QQ" src="https://img.shields.io/badge/QQ Group-%2312B7F5?logo=tencent-qq&logoColor=white&style=flat-square"/> |
|
</a> |
|
<a target="_blank" href="https://hub.docker.com/r/fishaudio/fish-speech"> |
|
<img alt="Docker" src="https://img.shields.io/docker/pulls/fishaudio/fish-speech?style=flat-square&logo=docker"/> |
|
</a> |
|
</div> |
|
|
|
!!! warning |
|
์ด ์ฝ๋๋ฒ ์ด์ค์ ๋ถ๋ฒ์ ์ธ ์ฌ์ฉ์ ๋ํด์๋ ์ฑ
์์ ์ง์ง ์์ต๋๋ค. DMCA(Digital Millennium Copyright Act) ๋ฐ ํด๋น ์ง์ญ์ ๊ด๋ จ ๋ฒ๋ฅ ์ ์ฐธ์กฐํ์ญ์์ค. <br/> |
|
์ด ์ฝ๋๋ฒ ์ด์ค์ ๋ชจ๋ ๋ชจ๋ธ์ CC-BY-NC-SA-4.0 ๋ผ์ด์ ์ค์ ๋ฐ๋ผ ๋ฐฐํฌ๋ฉ๋๋ค. |
|
|
|
<p align="center"> |
|
<img src="../assets/figs/diagram.png" width="75%"> |
|
</p> |
|
|
|
## ์๊ตฌ ์ฌํญ |
|
|
|
- GPU ๋ฉ๋ชจ๋ฆฌ: 4GB (์ถ๋ก ์ฉ), 8GB (ํ์ธํ๋์ฉ) |
|
- ์์คํ
: Linux, Windows |
|
|
|
## Windows ์ค์ |
|
|
|
๊ณ ๊ธ Windows ์ฌ์ฉ์๋ WSL2 ๋๋ Docker๋ฅผ ์ฌ์ฉํ์ฌ ์ฝ๋๋ฒ ์ด์ค๋ฅผ ์คํํ๋ ๊ฒ์ ๊ณ ๋ คํ ์ ์์ต๋๋ค. |
|
|
|
```bash |
|
# ํ์ด์ฌ 3.10 ๊ฐ์ ํ๊ฒฝ ์์ฑ, virtualenv๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. |
|
conda create -n fish-speech python=3.10 |
|
conda activate fish-speech |
|
|
|
# pytorch ์ค์น |
|
pip3 install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/cu121 |
|
|
|
# fish-speech ์ค์น |
|
pip3 install -e . |
|
|
|
# (๊ฐ์ ํ์ฑํ) triton-windows ์ค์น |
|
pip install https://github.com/AnyaCoder/fish-speech/releases/download/v0.1.0/triton_windows-0.1.0-py3-none-any.whl |
|
``` |
|
|
|
๋น์ ๋ฌธ Windows ์ฌ์ฉ์๋ Linux ํ๊ฒฝ ์์ด ํ๋ก์ ํธ๋ฅผ ์คํํ ์ ์๋ ๋ค์ ๊ธฐ๋ณธ ๋ฐฉ๋ฒ์ ๊ณ ๋ คํ ์ ์์ต๋๋ค (๋ชจ๋ธ ์ปดํ์ผ ๊ธฐ๋ฅ ํฌํจ, ์ฆ `torch.compile`): |
|
|
|
1. ํ๋ก์ ํธ ํจํค์ง ์ถ์ถ. |
|
2. `install_env.bat`์ ํด๋ฆญํ์ฌ ํ๊ฒฝ ์ค์น. |
|
3. ์ปดํ์ผ ๊ฐ์์ ํ์ฑํํ๋ ค๋ฉด ์๋ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์: |
|
1. LLVM ์ปดํ์ผ๋ฌ ๋ค์ด๋ก๋: |
|
- [LLVM-17.0.6 (๊ณต์ ์ฌ์ดํธ)](https://huggingface.co/fishaudio/fish-speech-1/resolve/main/LLVM-17.0.6-win64.exe?download=true) |
|
- [LLVM-17.0.6 (๋ฏธ๋ฌ ์ฌ์ดํธ)](https://hf-mirror.com/fishaudio/fish-speech-1/resolve/main/LLVM-17.0.6-win64.exe?download=true) |
|
- `LLVM-17.0.6-win64.exe`๋ฅผ ๋ค์ด๋ก๋ ํ ๋๋ธํด๋ฆญํ์ฌ ์ค์นํ๊ณ , ์ค์น ๊ฒฝ๋ก ์ ํ ์ `Add Path to Current User` ์ต์
์ ์ฒดํฌํ์ฌ ํ๊ฒฝ ๋ณ์๋ฅผ ์ถ๊ฐํฉ๋๋ค. |
|
- ์ค์น๊ฐ ์๋ฃ๋์๋์ง ํ์ธํฉ๋๋ค. |
|
2. Microsoft Visual C++ ์ฌ๋ฐฐํฌ ๊ฐ๋ฅ ํจํค์ง๋ฅผ ๋ค์ด๋ก๋ํ์ฌ .dll ๋๋ฝ ๋ฌธ์ ํด๊ฒฐ: |
|
- [MSVC++ 14.40.33810.0 ๋ค์ด๋ก๋](https://aka.ms/vs/17/release/vc_redist.x64.exe) |
|
3. Visual Studio Community Edition์ ๋ค์ด๋ก๋ํ์ฌ LLVM์ ํค๋ ํ์ผ ์์กด์ฑ์ ํด๊ฒฐ: |
|
- [Visual Studio ๋ค์ด๋ก๋](https://visualstudio.microsoft.com/zh-hans/downloads/) |
|
- Visual Studio Installer๋ฅผ ์ค์นํ ํ Visual Studio Community 2022๋ฅผ ๋ค์ด๋ก๋. |
|
- `Desktop development with C++` ์ต์
์ ์ ํํ์ฌ ์ค์น. |
|
4. [CUDA Toolkit 12.x](https://developer.nvidia.com/cuda-12-1-0-download-archive?target_os=Windows&target_arch=x86_64) ๋ค์ด๋ก๋ ๋ฐ ์ค์น. |
|
4. `start.bat`์ ๋๋ธ ํด๋ฆญํ์ฌ ํ๋ จ ์ถ๋ก WebUI ๊ด๋ฆฌ ์ธํฐํ์ด์ค๋ฅผ ์ฝ๋๋ค. ํ์ํ ๊ฒฝ์ฐ ์๋ ์ง์นจ์ ๋ฐ๋ผ `API_FLAGS`๋ฅผ ์์ ํ ์ ์์ต๋๋ค. |
|
|
|
!!! info "Optional" |
|
|
|
์ถ๋ก ์ ์ํด WebUI๋ฅผ ์ฌ์ฉํ๊ณ ์ ํ์๋์? |
|
|
|
ํ๋ก์ ํธ ๋ฃจํธ ๋๋ ํ ๋ฆฌ์ `API_FLAGS.txt` ํ์ผ์ ํธ์งํ๊ณ ์ฒซ ์ธ ์ค์ ์๋์ ๊ฐ์ด ์์ ํ์ธ์: |
|
``` |
|
--infer |
|
# --api |
|
# --listen ... |
|
... |
|
``` |
|
|
|
!!! info "Optional" |
|
|
|
API ์๋ฒ๋ฅผ ์์ํ๊ณ ์ถ์ผ์ ๊ฐ์? |
|
|
|
ํ๋ก์ ํธ ๋ฃจํธ ๋๋ ํ ๋ฆฌ์ `API_FLAGS.txt` ํ์ผ์ ํธ์งํ๊ณ ์ฒซ ์ธ ์ค์ ์๋์ ๊ฐ์ด ์์ ํ์ธ์: |
|
|
|
``` |
|
# --infer |
|
--api |
|
--listen ... |
|
... |
|
``` |
|
|
|
!!! info "Optional" |
|
|
|
`run_cmd.bat`์ ๋๋ธ ํด๋ฆญํ์ฌ ์ด ํ๋ก์ ํธ์ conda/python ๋ช
๋ น์ค ํ๊ฒฝ์ ์ง์
ํ ์ ์์ต๋๋ค. |
|
|
|
## Linux ์ค์ |
|
|
|
[pyproject.toml](../../pyproject.toml)์์ ์์ธํ ๋ด์ฉ์ ํ์ธํ์ธ์. |
|
```bash |
|
# ํ์ด์ฌ 3.10 ๊ฐ์ ํ๊ฒฝ ์์ฑ, virtualenv๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. |
|
conda create -n fish-speech python=3.10 |
|
conda activate fish-speech |
|
|
|
# (Ubuntu / Debian ์ฌ์ฉ์) sox + ffmpeg ์ค์น |
|
apt install libsox-dev ffmpeg |
|
|
|
# (Ubuntu / Debian ์ฌ์ฉ์) pyaudio ์ค์น |
|
apt install build-essential \ |
|
cmake \ |
|
libasound-dev \ |
|
portaudio19-dev \ |
|
libportaudio2 \ |
|
libportaudiocpp0 |
|
|
|
# pytorch ์ค์น |
|
pip3 install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 |
|
|
|
# fish-speech ์ค์น |
|
pip3 install -e .[stable] |
|
``` |
|
|
|
## macos ์ค์ |
|
|
|
MPS์์ ์ถ๋ก ์ ์ํํ๋ ค๋ฉด `--device mps` ํ๋๊ทธ๋ฅผ ์ถ๊ฐํ์ธ์. |
|
์ถ๋ก ์๋ ๋น๊ต๋ [์ด PR](https://github.com/fishaudio/fish-speech/pull/461#issuecomment-2284277772)์ ์ฐธ์กฐํ์ญ์์ค. |
|
|
|
!!! warning |
|
Apple Silicon ์ฅ์น์์๋ `compile` ์ต์
์ด ๊ณต์์ ์ผ๋ก ์ง์๋์ง ์์ผ๋ฏ๋ก ์ถ๋ก ์๋๊ฐ ํฅ์๋๋ค๋ ๋ณด์ฅ์ ์์ต๋๋ค. |
|
|
|
```bash |
|
# ํ์ด์ฌ 3.10 ๊ฐ์ ํ๊ฒฝ ์์ฑ, virtualenv๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. |
|
conda create -n fish-speech python=3.10 |
|
conda activate fish-speech |
|
# pytorch ์ค์น |
|
pip install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 |
|
# fish-speech ์ค์น |
|
pip install -e .[stable] |
|
``` |
|
|
|
## Docker ์ค์ |
|
|
|
1. NVIDIA Container Toolkit ์ค์น: |
|
|
|
Docker์์ ๋ชจ๋ธ ํ๋ จ ๋ฐ ์ถ๋ก ์ GPU๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด NVIDIA Container Toolkit์ ์ค์นํด์ผ ํฉ๋๋ค: |
|
|
|
Ubuntu ์ฌ์ฉ์: |
|
|
|
```bash |
|
# ์ ์ฅ์ ์ถ๊ฐ |
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ |
|
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ |
|
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ |
|
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list |
|
# nvidia-container-toolkit ์ค์น |
|
sudo apt-get update |
|
sudo apt-get install -y nvidia-container-toolkit |
|
# Docker ์๋น์ค ์ฌ์์ |
|
sudo systemctl restart docker |
|
``` |
|
|
|
๋ค๋ฅธ Linux ๋ฐฐํฌํ ์ฌ์ฉ์๋: [NVIDIA Container Toolkit ์ค์น ๊ฐ์ด๋](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)๋ฅผ ์ฐธ์กฐํ์ญ์์ค. |
|
|
|
2. fish-speech ์ด๋ฏธ์ง ๊ฐ์ ธ์ค๊ธฐ ๋ฐ ์คํ |
|
|
|
```bash |
|
# ์ด๋ฏธ์ง ๊ฐ์ ธ์ค๊ธฐ |
|
docker pull fishaudio/fish-speech:latest-dev |
|
# ์ด๋ฏธ์ง ์คํ |
|
docker run -it \ |
|
--name fish-speech \ |
|
--gpus all \ |
|
-p 7860:7860 \ |
|
fishaudio/fish-speech:latest-dev \ |
|
zsh |
|
# ๋ค๋ฅธ ํฌํธ๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด -p ๋งค๊ฐ๋ณ์๋ฅผ YourPort:7860์ผ๋ก ์์ ํ์ธ์ |
|
``` |
|
|
|
3. ๋ชจ๋ธ ์ข
์์ฑ ๋ค์ด๋ก๋ |
|
|
|
Docker ์ปจํ
์ด๋ ๋ด๋ถ์ ํฐ๋ฏธ๋์์ ์๋ ๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํ์ฌ ํ์ํ `vqgan` ๋ฐ `llama` ๋ชจ๋ธ์ Huggingface ๋ฆฌํฌ์งํ ๋ฆฌ์์ ๋ค์ด๋ก๋ํฉ๋๋ค. |
|
|
|
```bash |
|
huggingface-cli download fishaudio/fish-speech-1.5 --local-dir checkpoints/fish-speech-1.5 |
|
``` |
|
|
|
4. ํ๊ฒฝ ๋ณ์ ์ค์ ๋ฐ WebUI ์ ๊ทผ |
|
|
|
Docker ์ปจํ
์ด๋ ๋ด๋ถ์ ํฐ๋ฏธ๋์์ `export GRADIO_SERVER_NAME="0.0.0.0"`๋ฅผ ์
๋ ฅํ์ฌ Docker ๋ด๋ถ์์ Gradio ์๋น์ค์ ์ธ๋ถ ์ ๊ทผ์ ํ์ฉํฉ๋๋ค. |
|
์ดํ, ํฐ๋ฏธ๋์์ `python tools/run_webui.py` ๋ช
๋ น์ด๋ฅผ ์
๋ ฅํ์ฌ WebUI ์๋น์ค๋ฅผ ์์ํฉ๋๋ค. |
|
|
|
WSL ๋๋ macOS๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ [http://localhost:7860](http://localhost:7860)์์ WebUI ์ธํฐํ์ด์ค๋ฅผ ์ด ์ ์์ต๋๋ค. |
|
|
|
์๋ฒ์ ๋ฐฐํฌ๋ ๊ฒฝ์ฐ, localhost๋ฅผ ์๋ฒ์ IP๋ก ๊ต์ฒดํ์ธ์. |
|
|
|
## ๋ณ๊ฒฝ ์ฌํญ |
|
|
|
- 2024/09/10: Fish-Speech 1.4 ๋ฒ์ ์ผ๋ก ์
๋ฐ์ดํธ, ๋ฐ์ดํฐ์
ํฌ๊ธฐ ์ฆ๊ฐ ๋ฐ ์์ํ๊ธฐ์ n_groups๋ฅผ 4์์ 8๋ก ๋ณ๊ฒฝ. |
|
- 2024/07/02: Fish-Speech 1.2 ๋ฒ์ ์ผ๋ก ์
๋ฐ์ดํธ, VITS ๋์ฝ๋ ์ ๊ฑฐ ๋ฐ ์ ๋ก์ท ๋ฅ๋ ฅ ํฌ๊ฒ ํฅ์. |
|
- 2024/05/10: Fish-Speech 1.1 ๋ฒ์ ์ผ๋ก ์
๋ฐ์ดํธ, WER ๊ฐ์ ๋ฐ ์์ ์ ์ฌ์ฑ์ ๊ฐ์ ํ๊ธฐ ์ํด VITS ๋์ฝ๋ ๊ตฌํ. |
|
- 2024/04/22: Fish-Speech 1.0 ๋ฒ์ ์๋ฃ, VQGAN ๋ฐ LLAMA ๋ชจ๋ธ ๋ํญ ์์ . |
|
- 2023/12/28: `lora` ํ์ธํ๋ ์ง์ ์ถ๊ฐ. |
|
- 2023/12/27: `gradient checkpointing`, `causual sampling`, ๋ฐ `flash-attn` ์ง์ ์ถ๊ฐ. |
|
- 2023/12/19: WebUI ๋ฐ HTTP API ์
๋ฐ์ดํธ. |
|
- 2023/12/18: ํ์ธํ๋ ๋ฌธ์ ๋ฐ ๊ด๋ จ ์์ ์
๋ฐ์ดํธ. |
|
- 2023/12/17: `text2semantic` ๋ชจ๋ธ ์
๋ฐ์ดํธ, ์์ ์๋ ๋ชจ๋ ์ง์. |
|
- 2023/12/13: ๋ฒ ํ ๋ฒ์ ์ถ์, VQGAN ๋ชจ๋ธ ๋ฐ LLAMA ๊ธฐ๋ฐ ์ธ์ด ๋ชจ๋ธ(์์ ์ง์๋ง ํฌํจ). |
|
|
|
## ๊ฐ์ฌ์ ๋ง |
|
|
|
- [VITS2 (daniilrobnikov)](https://github.com/daniilrobnikov/vits2) |
|
- [Bert-VITS2](https://github.com/fishaudio/Bert-VITS2) |
|
- [GPT VITS](https://github.com/innnky/gpt-vits) |
|
- [MQTTS](https://github.com/b04901014/MQTTS) |
|
- [GPT Fast](https://github.com/pytorch-labs/gpt-fast) |
|
- [Transformers](https://github.com/huggingface/transformers) |
|
- [GPT-SoVITS](https://github.com/RVC-Boss/GPT-SoVITS) |
|
|