如何在windows上本地部署audiocraft,实现电脑AI作曲

如何在windows上本地部署audiocraft,实现电脑AI作曲。
设备配置:CPU E3-1240v3, RAM 32G, SSD 1T, GPU0 Nvidia 1080ti,GPU1 Nvidia T4
OS:Windows10专业版
【python安装】
1、下载安装python 3.10.9
https://www.python.org/ftp/python/3.10.9/python-3.10.9-amd64.exe
2、下载安装git
https://git-scm.com/downloads
 
3、下载解压ffmpeg
打开:https://github.com/GyanD/codexffmpeg/releases
下载:ffmpeg-6.0-full_build-shared.zip
解压:ffmpeg-6.0-full_build-shared.zip 到根目录(例如:c:\ffmpeg-6.0-full_build-shared)
将C:\ffmpeg-6.0-full_build-shared\bin 添加到系统环境变量 path里面
 
4、克隆项目
cd c:\
git clone https://github.com/facebookresearch/audiocraft

5、创建激活python虚拟环境
cd audiocraft
python -m venv venv
cd venv
cd scripts
activate

6、安装torch torchvision torchaudio三个核心库
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
 
7、安装项目依赖
cd..
cd..
pip install -e . -i https://pypi.mirrors.ustc.edu.cn/simple/
 
8、安装xformers和gradio
pip uninstall -y xformers
pip install xformers  -i https://pypi.mirrors.ustc.edu.cn/simple/
pip install gradio  -i https://pypi.mirrors.ustc.edu.cn/simple/
 
9、激活运行
call .\venv\Scripts\activate.bat
python app.py

10、解决 Error caught was: No module named ‘triton’错误
下载:https://pypi.org/project/cmake/#files 的 cmake-3.26.4-py2.py3-none-win_amd64.whl 文件
下载:https://huggingface.co/r4ziel/xformers_pre_built/blob/main/triton-2.0.0-cp310-cp310-win_amd64.whl
python -m pip install cmake-3.26.4-py2.py3-none-win_amd64.whl
python -m pip install triton-2.0.0-cp310-cp310-win_amd64.whl
 
【用Anaconda安装】
1、下载安装git
https://git-scm.com/downloads
 
2、下载解压ffmpeg
打开:https://github.com/GyanD/codexffmpeg/releases
下载:ffmpeg-6.0-full_build-shared.zip
解压:ffmpeg-6.0-full_build-shared.zip 到根目录(例如:c:\ffmpeg-6.0-full_build-shared)
将C:\ffmpeg-6.0-full_build-shared\bin 添加到系统环境变量 path里面

3、安装Anaconda:
打开:https://www.anaconda.com/download/
下载Anaconda并安装
 
4、克隆项目
cd c:\
git clone https://github.com/facebookresearch/audiocraft

5、创建环境
点击“开始”,在Ananconda里面,打开Anaconda Powershell Prompt
更新 Conda 至最新版本:conda update conda
建立环境:conda create -n audiocraft python==3.10.9
激活环境:conda activate  audiocraft

5、安装依赖
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install -e . -i https://pypi.mirrors.ustc.edu.cn/simple/

6、解决 Error caught was: No module named ‘triton’错误
下载:https://pypi.org/project/cmake/#files 的 cmake-3.26.4-py2.py3-none-win_amd64.whl 文件
下载:https://huggingface.co/r4ziel/xformers_pre_built/blob/main/triton-2.0.0-cp310-cp310-win_amd64.whl
python -m pip install cmake-3.26.4-py2.py3-none-win_amd64.whl
python -m pip install triton-2.0.0-cp310-cp310-win_amd64.whl

7、启动运行
cd  c:\audiocraft
python app.py

猜你喜欢

转载自blog.csdn.net/qq_43335960/article/details/131289943