Skip to content

For AI beginners, deploying AI software from source code can be challenging. An all-in-one package simplifies this: just download, extract, and double-click to use, significantly lowering the barrier to entry. However, sometimes a ready-made package isn't available, or existing ones aren't updated. In such cases, you can try creating your own all-in-one package and sharing it with others.

AI project models are often very large, and with GPU support, even when compressed into 7z format, the file size can easily exceed 5GB. This makes uploading to cloud storage and local storage difficult. Therefore, I will no longer be creating all-in-one packages myself. If you are interested, you can follow this tutorial to create and share your own.

This tutorial uses F5-TTS as an example to create an all-in-one package on Windows 10 using Python 3.10. The main steps are as follows:

  1. Download the Python 3.10 embeddable version (not the .exe installer, but a .zip archive).
  2. Install pip and set the dependency lookup path for the project.
  3. Download F5-TTS source code.
  4. Install F5-TTS's dependency modules.
  5. Create a one-click launch script and set the model directory to the project directory.
  6. Configure proxy access to download models.
  7. Perform one cloning task to download Whisper and other models.
  8. Compress into an all-in-one package.
  9. Creating All-in-One Packages for Other AI Projects

Preparation Before Starting:

First, create an empty folder. To avoid errors, it's recommended to create an English-named folder on a non-system drive, for example, D:\f5win. This guide will use D:\f5win. Inside this folder, create another empty folder named runtime to store the Python 3.10 embeddable version files you'll download later.

Before you begin, please ensure you click "View" in the folder navigation bar and check "File name extensions." Otherwise, subsequent operations may lead to errors, especially for those unfamiliar with file extensions.

显示文件扩展名


1. Download Python 3.10 Embeddable Version

Important Note: You are downloading the embeddable version, not the .exe installer. This version does not rely on your machine's existing Python environment; even if you have Python installed, you still need to download this specific version.

  • Download Link: https://www.python.org/downloads/release/python-31011/

  • Scroll to the bottom of the page and click Windows embeddable package (64-bit) to download. This will give you a .zip archive.

    下载Python embed版本

    Be sure to download this specific version; do not make a mistake!

  • After downloading, extract the .zip archive and copy all its contents into the runtime folder you created earlier. As shown below:

    Python embed文件复制到runtime文件夹内


2. Install pip and Modify Package Search Path

The embeddable version of Python does not include the pip module, so you need to install it manually.

  • Install pip:

    • Open this address: https://bootstrap.pypa.io/get-pip.py

    • Right-click and "Save as..." to save the file into your runtime directory. After saving, the runtime folder should contain a file named get-pip.py.

      下载get-pip.pyget-pip.py文件runtime目录下的get-pip.py

    • In the address bar of the runtime folder, type cmd and press Enter to open a Command Prompt window (black window).

      打开cmd,并确认路径是否在runtime内

    • In the Command Prompt window, type the command .\python get-pip.py and press Enter. Crucially, ensure the current folder path displayed in the command line is inside the runtime folder; otherwise, it will cause an error.

      Wait for the installation to complete...

      pip安装中

      The pip module has been successfully installed!

      pip 模块安装成功

  • Modify python310._pth file:

    • In the runtime folder, find the file named python310._pth, right-click, and open it with Notepad.

      python310._pth文件内默认内容

    • On the line immediately following the dot symbol . on the second line, add the following three lines:

      ./Lib/site-packages
      ../src
      ../src/f5_tts
    • Save the file. The modified file content should look like this. Please double-check for accuracy:

      修改后的python310._pth文件内容应如下


3. Download F5-TTS Source Code

  • Open the F5-TTS project's GitHub repository: https://github.com/SWivid/F5-TTS

  • Download the source code as a .zip archive.

    下载F5-TTS源码

  • Extract the downloaded .zip package. Copy all files from inside the F5-TTS-main folder into the D:\f5win folder. Note: Copy the files inside, not the entire F5-TTS-main folder itself.

    复制F5-TTS-main内文件

    After extraction, the D:\f5win folder contents should look like this:

    正确复制后的D:5win目录结构


Back to the previous CMD window

From the same terminal window, execute the cd ../ command to ensure the path displayed before the command line is now D:\f5win (without runtime). All subsequent operations will be performed in the D:\f5win directory.

4. Install Dependency Modules

  • Return to the CMD terminal window and reconfirm that the path displayed on the current command line is D:\f5win (without runtime).

  • Execute the following command to install dependencies (pay attention to spaces and the dot symbol):

    .\runtime\python -m pip install -e .

    安装依赖中

    Wait for the installation to complete...

所有依赖安装完成

  • If you want the all-in-one package to support NVIDIA graphics cards (optional): Continue by executing the following command to install the CUDA version of PyTorch and torchaudio (pay attention to spaces and the dot symbol; the command must not wrap):
    .\runtime\python -m pip install torch==2.4.0+cu124 torchaudio==2.4.0+cu124 --extra-index-url https://download.pytorch.org/whl/cu124

5. Create a One-Click Launch Script

By default, models are saved to the user's directory on the C drive. To simplify packaging, we need to download models directly into the all-in-one package.

  • In the D:\f5win folder, right-click -> New -> Text Document, create a run.txt file, open it with Notepad, and enter the following code:

```bat
@echo off

chcp 65001 > nul

set "HF_HOME=%~dp0models"
set "MODELSCOPE_CACHE=%~dp0models"

echo HF_HOME: %HF_HOME%
echo MODELSCOPE_CACHE: %MODELSCOPE_CACHE%

"%~dp0runtime\python" -m f5_tts.infer.infer_gradio  --inbrowser

pause
```

The script above means: Save models to the models folder within the current directory, then launch the web interface and automatically open it in a browser.

  • After saving the file, rename run.txt to run.bat. A warning will pop up; select "Yes." If no warning appears, it means you failed to change the extension; please return to the "Preparation Before Starting" section at the top of this article and ensure file extensions are displayed.

    重命名为run.bat的警告弹窗


6. Configure Proxy Access

Due to network restrictions in some regions, direct access to Hugging Face (huggingface.co) where F5-TTS models are hosted might be blocked. Therefore, you need to configure a proxy access environment and set it as your system proxy.

For example, if your tool is v2ray, you can set it up like this:

v2ray中设置为系统代理

Once configured, double-click the run.bat file you just created.

  • If double-clicking opens the file with Notepad directly, it means you failed to change the file extension. Please go back to the "Preparation Before Starting" section at the top of this article and select "File name extensions" as instructed.

  • If double-clicking opens a black window, it will start downloading models to the D:\f5win\models folder.

    下载模型中

  • If you encounter an error similar to the image below, it indicates that you have not properly configured your proxy access environment or have not set it correctly as a system proxy, preventing connection to Hugging Face for model downloads.

    下载模型错误:无法连接到huggingface.co

    Sometimes, downloads might fail halfway. The most common reason is an unstable proxy node. Please switch to a more stable proxy or node.

  • Once the models are downloaded, a browser window will automatically open. 模型下载完毕,自动打开浏览器


7. Perform One Cloning Task to Download Whisper Model

When performing voice cloning without providing the text corresponding to the reference audio, F5-TTS will automatically download the Whisper model from Hugging Face. To ensure a complete package, we need to download it in advance.

  • In the automatically opened Web window, select a clean 5-10 second reference audio, enter the text you want to synthesize (e.g., "Hello friend"), then click "Synthesize."

    Web界面

  • This will start downloading the Whisper model.

    下载Whisper模型中

  • Once synthesis is successful and no errors occur, you can proceed to package the project into an all-in-one package.


8. Compress into an All-in-One Package

  • Before compressing, you can rename run.bat to Start_Me.bat (or 点我启动.bat if you prefer the original Chinese name for some users) to make it easier for new users to understand.
  • Compress the entire D:\f5win folder into a .zip file, or into a smaller .7z file.
  • Share the compressed package with others; they can extract it and double-click run.bat (or Start_Me.bat) to use it.


9. How to Create All-in-One Packages for Other AI Projects

Most Python-based open-source projects on GitHub can be packaged using a similar method. The main differences lie in these three points:

  1. Python Version: Python 3.10 is the most common version and suitable for most projects. If a project has specific requirements (e.g., 3.11 or 3.12), you can find the corresponding Windows embeddable package (64-bit) on this page: https://www.python.org/downloads/windows/. It is crucial not to download the .exe installer.

  2. Contents of the python310._pth file:

    • ./Lib/site-packages must still be added.
    • Other paths should be added based on the actual project structure.
    • If the project has a code directory named cfg, add a line ../cfg.
    • If the project has a src directory containing other subfolders, continue adding ../src/foldername.
  3. Launch Command in the run.bat script:

    • Only this line of command needs to be modified:
      "%~dp0runtime\python" -m f5_tts.infer.infer_gradio  --inbrowser
    • The "%~dp0runtime\python" part remains unchanged. The subsequent part should be replaced with the command to launch the respective project (excluding python).
    • If you have doubts, you can provide the content of run.bat and the project's launch command to an AI and ask it to generate a new launch script, mimicking run.bat. Remember to tell the AI to use the Python interpreter from run.bat.