Skip to content

Commit dc8c834

Browse files
authored
Optimize Documents for Windows (#266)
* Add Windows Setup Help * Optimize documents/bootscripts for Windows User * Correct some description
1 parent 009f32f commit dc8c834

File tree

5 files changed

+174
-119
lines changed

5 files changed

+174
-119
lines changed

docs/assets/figs/VS_1.jpg

27.3 KB
Loading

docs/en/index.md

+55-42
Original file line numberDiff line numberDiff line change
@@ -26,54 +26,67 @@ This codebase is released under the `BSD-3-Clause` license, and all models are r
2626
- GPU Memory: 4GB (for inference), 16GB (for fine-tuning)
2727
- System: Linux, Windows
2828

29-
~~We recommend Windows users to use WSL2 or docker to run the codebase, or use the integrated environment developed by the community.~~
30-
3129
## Windows Setup
3230

3331
Windows professional users may consider WSL2 or Docker to run the codebase.
3432

3533
Non-professional Windows users can consider the following methods to run the codebase without a Linux environment (with model compilation capabilities aka `torch.compile`):
3634

37-
0. Extract the project zip file.
38-
1. Click `install_env.bat` to install the environment.
39-
40-
1. You can decide whether to use a mirror site for downloading by editing the `USE_MIRROR` item in `install_env.bat`.
41-
2. The default is `preview`, using a mirror site and the latest development version of torch (the only way to activate the compilation method).
42-
3. `false` uses the original site to download the environment. `true` uses the mirror site to download the stable version of torch and other environments.
43-
44-
2. (Optional, this step is to activate the model compilation environment)
45-
46-
1. Use the following links to download the `LLVM` compiler.
47-
48-
- [LLVM-17.0.6 (original site download)](https://huggingface.co/fishaudio/fish-speech-1/resolve/main/LLVM-17.0.6-win64.exe?download=true)
49-
- [LLVM-17.0.6 (mirror site download)](https://hf-mirror.com/fishaudio/fish-speech-1/resolve/main/LLVM-17.0.6-win64.exe?download=true)
50-
- After downloading `LLVM-17.0.6-win64.exe`, double-click to install, choose the appropriate installation location, and most importantly, check `Add Path to Current User` to add the environment variable.
51-
- Confirm the installation is complete.
52-
53-
2. Download and install the Microsoft Visual C++ Redistributable Package to resolve potential .dll missing issues.
54-
- [MSVC++ 14.40.33810.0 download](https://aka.ms/vs/17/release/vc_redist.x64.exe)
55-
56-
3. Double-click `start.bat` to enter the Fish-Speech training and inference configuration WebUI page.
57-
58-
- Want to go directly to the inference page? Edit the `API_FLAGS.txt` in the project root directory, and modify the first three lines as follows:
59-
60-
```text
61-
--infer
62-
# --api
63-
# --listen ...
64-
...
65-
```
66-
67-
- Want to start the API server? Edit the API_FLAGS.txt in the project root directory, and modify the first three lines as follows:
68-
69-
```text
70-
# --infer
71-
--api
72-
--listen ...
73-
...
74-
```
75-
76-
4. (Optional) Double-click run_cmd.bat to enter the conda/python command line environment of this project.
35+
<ol>
36+
<li>Unzip the project package.</li>
37+
<li>Click <code>install_env.bat</code> to install the environment.
38+
<ul>
39+
<li>You can decide whether to use a mirror site for downloads by editing the <code>USE_MIRROR</code> item in <code>install_env.bat</code>.</li>
40+
<li><code>USE_MIRROR=false</code> downloads the latest stable version of <code>torch</code> from the original site. <code>USE_MIRROR=true</code> downloads the latest version of <code>torch</code> from a mirror site. The default is <code>true</code>.</li>
41+
<li>You can decide whether to enable the compiled environment download by editing the <code>INSTALL_TYPE</code> item in <code>install_env.bat</code>.</li>
42+
<li><code>INSTALL_TYPE=preview</code> downloads the preview version with the compiled environment. <code>INSTALL_TYPE=stable</code> downloads the stable version without the compiled environment.</li>
43+
</ul>
44+
</li>
45+
<li>If step 2 has <code>USE_MIRROR=preview</code>, execute this step (optional, for activating the compiled model environment):
46+
<ol>
47+
<li>Download the LLVM compiler using the following links:
48+
<ul>
49+
<li><a href="https://huggingface.co/fishaudio/fish-speech-1/resolve/main/LLVM-17.0.6-win64.exe?download=true">LLVM-17.0.6 (original site download)</a></li>
50+
<li><a href="https://hf-mirror.com/fishaudio/fish-speech-1/resolve/main/LLVM-17.0.6-win64.exe?download=true">LLVM-17.0.6 (mirror site download)</a></li>
51+
<li>After downloading <code>LLVM-17.0.6-win64.exe</code>, double-click to install it, choose an appropriate installation location, and most importantly, check <code>Add Path to Current User</code> to add to the environment variables.</li>
52+
<li>Confirm the installation is complete.</li>
53+
</ul>
54+
</li>
55+
<li>Download and install the Microsoft Visual C++ Redistributable package to resolve potential .dll missing issues.
56+
<ul>
57+
<li><a href="https://aka.ms/vs/17/release/vc_redist.x64.exe">MSVC++ 14.40.33810.0 Download</a></li>
58+
</ul>
59+
</li>
60+
<li>Download and install Visual Studio Community Edition to obtain MSVC++ build tools, resolving LLVM header file dependencies.
61+
<ul>
62+
<li><a href="https://visualstudio.microsoft.com/zh-hans/downloads/">Visual Studio Download</a></li>
63+
<li>After installing Visual Studio Installer, download Visual Studio Community 2022.</li>
64+
<li>Click the <code>Modify</code> button as shown below, find the <code>Desktop development with C++</code> option, and check it for download.</li>
65+
<p align="center">
66+
<img src="/assets/figs/VS_1.jpg" width="75%">
67+
</p>
68+
</ul>
69+
</li>
70+
</ol>
71+
</li>
72+
<li>Double-click <code>start.bat</code> to enter the Fish-Speech training inference configuration WebUI page.
73+
<ul>
74+
<li>(Optional) Want to go directly to the inference page? Edit the <code>API_FLAGS.txt</code> in the project root directory and modify the first three lines as follows:
75+
<pre><code>--infer
76+
# --api
77+
# --listen ...
78+
...</code></pre>
79+
</li>
80+
<li>(Optional) Want to start the API server? Edit the <code>API_FLAGS.txt</code> in the project root directory and modify the first three lines as follows:
81+
<pre><code># --infer
82+
--api
83+
--listen ...
84+
...</code></pre>
85+
</li>
86+
</ul>
87+
</li>
88+
<li>(Optional) Double-click <code>run_cmd.bat</code> to enter the conda/python command line environment of this project.</li>
89+
</ol>
7790

7891
## Linux Setup
7992

docs/zh/index.md

+55-38
Original file line numberDiff line numberDiff line change
@@ -26,50 +26,67 @@
2626
- GPU 内存: 4GB (用于推理), 16GB (用于微调)
2727
- 系统: Linux, Windows
2828

29-
~~我们建议 Windows 用户使用 WSL2 或 docker 来运行代码库, 或者使用由社区开发的整合环境.~~
30-
3129
## Windows 配置
3230

3331
Windows 专业用户可以考虑 WSL2 或 docker 来运行代码库。
3432

3533
Windows 非专业用户可考虑以下为免 Linux 环境的基础运行方法(附带模型编译功能,即 `torch.compile`):
3634

37-
0. 解压项目压缩包。
38-
1. 点击`install_env.bat`安装环境。
39-
- 可以通过编辑`install_env.bat``USE_MIRROR`项来决定是否使用镜像站下载。
40-
- 默认为`preview`, 使用镜像站且使用最新开发版本 torch(唯一激活编译方式)。
41-
- `false`使用原始站下载环境。`true`为从镜像站下载稳定版本 torch 和其余环境。
42-
2. (可跳过,此步为激活编译模型环境)
43-
44-
1. 使用如下链接下载`LLVM`编译器。
45-
- [LLVM-17.0.6 (原始站点下载)](https://huggingface.co/fishaudio/fish-speech-1/resolve/main/LLVM-17.0.6-win64.exe?download=true)
46-
- [LLVM-17.0.6 (镜像站点下载)](https://hf-mirror.com/fishaudio/fish-speech-1/resolve/main/LLVM-17.0.6-win64.exe?download=true)
47-
- 下载完`LLVM-17.0.6-win64.exe`后,双击进行安装,选择合适的安装位置,最重要的是勾选`Add Path to Current User`添加环境变量。
48-
- 确认安装完成。
49-
2. 下载安装`Microsoft Visual C++ 可再发行程序包`, 解决潜在`.dll`丢失问题。
50-
- [MSVC++ 14.40.33810.0 下载](https://aka.ms/vs/17/release/vc_redist.x64.exe)
51-
52-
3. 双击`start.bat`, 进入 Fish-Speech 训练推理配置 WebUI 页面。
53-
54-
- 想直接进入推理页面?编辑项目根目录下的`API_FLAGS.txt`, 前三行修改成如下格式:
55-
56-
```text
57-
--infer
58-
# --api
59-
# --listen ...
60-
...
61-
```
62-
63-
- 想启动 API 服务器?编辑项目根目录下的`API_FLAGS.txt`, 前三行修改成如下格式:
64-
65-
```text
66-
# --infer
67-
--api
68-
--listen ...
69-
...
70-
```
71-
72-
4. (可选)双击`run_cmd.bat`进入本项目的 conda/python 命令行环境
35+
<ol>
36+
<li>解压项目压缩包。</li>
37+
<li>点击 install_env.bat 安装环境。
38+
<ul>
39+
<li>可以通过编辑 install_env.bat 的 <code>USE_MIRROR</code> 项来决定是否使用镜像站下载。</li>
40+
<li><code>USE_MIRROR=false</code> 使用原始站下载最新稳定版 <code>torch</code> 环境。<code>USE_MIRROR=true</code> 为从镜像站下载最新 <code>torch</code> 环境。默认为 <code>true</code>。</li>
41+
<li>可以通过编辑 install_env.bat 的 <code>INSTALL_TYPE</code> 项来决定是否启用可编译环境下载。</li>
42+
<li><code>INSTALL_TYPE=preview</code> 下载开发版编译环境。<code>INSTALL_TYPE=stable</code> 下载稳定版不带编译环境。</li>
43+
</ul>
44+
</li>
45+
<li>若第2步 INSTALL_TYPE=preview 则执行这一步(可跳过,此步为激活编译模型环境)
46+
<ol>
47+
<li>使用如下链接下载 LLVM 编译器。
48+
<ul>
49+
<li><a href="https://huggingface.co/fishaudio/fish-speech-1/resolve/main/LLVM-17.0.6-win64.exe?download=true">LLVM-17.0.6(原站站点下载)</a></li>
50+
<li><a href="https://hf-mirror.com/fishaudio/fish-speech-1/resolve/main/LLVM-17.0.6-win64.exe?download=true">LLVM-17.0.6(镜像站点下载)</a></li>
51+
<li>下载完 LLVM-17.0.6-win64.exe 后,双击进行安装,选择合适的安装位置,最重要的是勾选 <code>Add Path to Current User</code> 添加环境变量。</li>
52+
<li>确认安装完成。</li>
53+
</ul>
54+
</li>
55+
<li>下载安装 Microsoft Visual C++ 可再发行程序包,解决潜在 .dll 丢失问题。
56+
<ul>
57+
<li><a href="https://aka.ms/vs/17/release/vc_redist.x64.exe">MSVC++ 14.40.33810.0 下载</a></li>
58+
</ul>
59+
</li>
60+
<li>下载安装 Visual Studio 社区版以获取 MSVC++ 编译工具, 解决 LLVM 的头文件依赖问题。
61+
<ul>
62+
<li><a href="https://visualstudio.microsoft.com/zh-hans/downloads/">Visual Studio 下载</a></li>
63+
<li>安装好Visual Studio Installer之后,下载Visual Studio Community 2022</li>
64+
<li>如下图点击<code>修改</code>按钮,找到<code>使用C++的桌面开发</code>项,勾选下载</li>
65+
<p align="center">
66+
<img src="/assets/figs/VS_1.jpg" width="75%">
67+
</p>
68+
</ul>
69+
</li>
70+
</ol>
71+
</li>
72+
<li>双击 start.bat, 进入 Fish-Speech 训练推理配置 WebUI 页面。
73+
<ul>
74+
<li>(可选) 想直接进入推理页面?编辑项目根目录下的 <code>API_FLAGS.txt</code>, 前三行修改成如下格式:
75+
<pre><code>--infer
76+
# --api
77+
# --listen ...
78+
...</code></pre>
79+
</li>
80+
<li>(可选) 想启动 API 服务器?编辑项目根目录下的 <code>API_FLAGS.txt</code>, 前三行修改成如下格式:
81+
<pre><code># --infer
82+
--api
83+
--listen ...
84+
...</code></pre>
85+
</li>
86+
</ul>
87+
</li>
88+
<li>(可选)双击 <code>run_cmd.bat</code> 进入本项目的 conda/python 命令行环境</li>
89+
</ol>
7390

7491
## Linux 配置
7592

install_env.bat

+53-36
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
@echo off
22
chcp 65001
33

4-
set USE_MIRROR=preview
4+
set USE_MIRROR=true
55
set INSTALL_TYPE=preview
6-
echo use_mirror = %USE_MIRROR%
6+
echo "USE_MIRROR: %USE_MIRROR%"
7+
echo "INSTALL_TYPE: %INSTALL_TYPE%"
78
setlocal enabledelayedexpansion
89

910
cd /D "%~dp0"
@@ -124,11 +125,14 @@ if "!INSTALL_TYPE!" == "preview" (
124125
set "packages=!packages! triton_windows"
125126
)
126127

127-
set "HF_ENDPOINT=https://hf-mirror.com"
128-
if "!USE_MIRROR!" == "false" (
129-
set "HF_ENDPOINT=https://huggingface.co"
128+
set "HF_ENDPOINT=https://huggingface.co"
129+
set "no_proxy="
130+
if "!USE_MIRROR!" == "true" (
131+
set "HF_ENDPOINT=https://hf-mirror.com"
132+
set "no_proxy=localhost, 127.0.0.1, 0.0.0.0"
130133
)
131134
echo "HF_ENDPOINT: !HF_ENDPOINT!"
135+
echo "NO_PROXY: !no_proxy!"
132136

133137
set "install_packages="
134138
for %%p in (%packages%) do (
@@ -138,47 +142,17 @@ for %%p in (%packages%) do (
138142
)
139143
)
140144

141-
142145
if not "!install_packages!"=="" (
143146
echo.
144147
echo Installing: !install_packages!
145-
146148
for %%p in (!install_packages!) do (
147-
if "!USE_MIRROR!"=="true" (
148-
if "%%p"=="torch" (
149-
%PIP_CMD% install torch --index-url https://mirror.sjtu.edu.cn/pytorch-wheels/cu121 --no-warn-script-location
150-
) else if "%%p"=="torchvision" (
151-
%PIP_CMD% install torchvision --index-url https://mirror.sjtu.edu.cn/pytorch-wheels/cu121 --no-warn-script-location
152-
) else if "%%p"=="torchaudio" (
153-
%PIP_CMD% install torchaudio --index-url https://mirror.sjtu.edu.cn/pytorch-wheels/cu121 --no-warn-script-location
154-
) else if "%%p"=="openai-whisper" (
155-
%PIP_CMD% install -i https://pypi.tuna.tsinghua.edu.cn/simple openai-whisper --no-warn-script-location
156-
) else if "%%p"=="fish-speech" (
157-
%PIP_CMD% install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple
158-
)
159-
)
160-
161-
if "!USE_MIRROR!"=="false" (
162-
if "%%p"=="torch" (
163-
%PIP_CMD% install torch==2.4.0.dev20240427+cu121 --index-url https://download.pytorch.org/whl/nightly/cu121 --no-warn-script-location
164-
) else if "%%p"=="torchvision" (
165-
%PIP_CMD% install torchvision==0.19.0.dev20240428+cu121 --index-url https://download.pytorch.org/whl/nightly/cu121 --no-warn-script-location
166-
) else if "%%p"=="torchaudio" (
167-
%PIP_CMD% install torchaudio==2.2.0.dev20240427+cu121 --index-url https://download.pytorch.org/whl/nightly/cu121 --no-warn-script-location
168-
) else if "%%p"=="openai-whisper" (
169-
%PIP_CMD% install openai-whisper --no-warn-script-location
170-
) else if "%%p"=="fish-speech" (
171-
%PIP_CMD% install -e .
172-
)
173-
)
174-
175149
if "!INSTALL_TYPE!"=="preview" (
176150
if "%%p"=="torch" (
177151
set "WHEEL_FILE=torch-2.4.0.dev20240427+cu121-cp310-cp310-win_amd64.whl"
178152
set "URL=!HF_ENDPOINT!/datasets/SpicyqSama007/windows_compile/resolve/main/torch-2.4.0.dev20240427_cu121-cp310-cp310-win_amd64.whl?download=true"
179153
set "CHKSUM=b091308f4cb74e63d0323afd67c92f2279d9e488d8cbf467bcc7b939bcd74e0b"
180154
:TORCH_DOWNLOAD
181-
echo "%CD%\!WHEEL_FILE!"
155+
echo "%CD%\!WHEEL_FILE!"
182156
if not exist "%CD%\!WHEEL_FILE!" (
183157
call curl -Lk "!URL!" --output "!WHEEL_FILE!"
184158
)
@@ -257,7 +231,50 @@ if not "!install_packages!"=="" (
257231
)
258232

259233
)
234+
)
235+
)
260236

237+
set "install_packages="
238+
for %%p in (%packages%) do (
239+
%PIP_CMD% show %%p >nul 2>&1
240+
if errorlevel 1 (
241+
set "install_packages=!install_packages! %%p"
242+
)
243+
)
244+
245+
if not "!install_packages!"=="" (
246+
echo.
247+
echo Installing: !install_packages!
248+
249+
for %%p in (!install_packages!) do (
250+
if "!USE_MIRROR!"=="true" (
251+
if "%%p"=="torch" (
252+
%PIP_CMD% install torch --index-url https://mirror.sjtu.edu.cn/pytorch-wheels/cu121 --no-warn-script-location
253+
) else if "%%p"=="torchvision" (
254+
%PIP_CMD% install torchvision --index-url https://mirror.sjtu.edu.cn/pytorch-wheels/cu121 --no-warn-script-location
255+
) else if "%%p"=="torchaudio" (
256+
%PIP_CMD% install torchaudio --index-url https://mirror.sjtu.edu.cn/pytorch-wheels/cu121 --no-warn-script-location
257+
) else if "%%p"=="openai-whisper" (
258+
%PIP_CMD% install -i https://pypi.tuna.tsinghua.edu.cn/simple openai-whisper --no-warn-script-location
259+
) else if "%%p"=="fish-speech" (
260+
%PIP_CMD% install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple
261+
)
262+
)
263+
264+
if "!USE_MIRROR!"=="false" (
265+
if "%%p"=="torch" (
266+
%PIP_CMD% install torch --index-url https://download.pytorch.org/whl/nightly/cu121 --no-warn-script-location
267+
) else if "%%p"=="torchvision" (
268+
%PIP_CMD% install torchvision --index-url https://download.pytorch.org/whl/nightly/cu121 --no-warn-script-location
269+
) else if "%%p"=="torchaudio" (
270+
%PIP_CMD% install torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121 --no-warn-script-location
271+
) else if "%%p"=="openai-whisper" (
272+
%PIP_CMD% install openai-whisper --no-warn-script-location
273+
) else if "%%p"=="fish-speech" (
274+
%PIP_CMD% install -e .
275+
)
276+
)
277+
261278
)
262279
)
263280
echo Environment Check: Success.

start.bat

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
@echo off
22
chcp 65001
33

4-
4+
set USE_MIRROR=true
55
set PYTHONPATH=%~dp0
66
set PYTHON_CMD=%cd%\fishenv\env\python
77
set API_FLAG_PATH=%~dp0API_FLAGS.txt
88

9-
set no_proxy="localhost, 127.0.0.1, 0.0.0.0"
10-
set HF_ENDPOINT=https://hf-mirror.com
9+
1110
%PYTHON_CMD% .\tools\download_models.py
1211

1312
setlocal enabledelayedexpansion
1413

14+
set "HF_ENDPOINT=https://huggingface.co"
15+
set "no_proxy="
16+
if "%USE_MIRROR%" == "true" (
17+
set "HF_ENDPOINT=https://hf-mirror.com"
18+
set "no_proxy=localhost, 127.0.0.1, 0.0.0.0"
19+
)
20+
echo "HF_ENDPOINT: !HF_ENDPOINT!"
21+
echo "NO_PROXY: !no_proxy!"
22+
1523
set "API_FLAGS="
1624
set "flags="
1725

0 commit comments

Comments
 (0)