在VSCODE中安装bark
win11,3060 显卡,VScode python3.10
官网Suno · GitHub
(全程不翻墙)
0.查看cuda版本 开始-运行-cmd输入 nvidia-smi 必要是更新驱动,

1.安装cuda
官网https://developer.nvidia.com/cuda-11-8-0-download-archive? target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local


2.安装pytorch2.0.0 根据cuda版本选择
官网https://pytorch.org/

3.安装git
官网 https://git-scm.com/

4.下载pysoundfile pip install pysoundfile
5.下载bark pip install git+https://github.com/suno-ai/bark.git
6.在下载的bark文件~~\Local\Programs\Python\Python310\Lib\site-packages\bark中
修改generation.py
USE_SMALL_MODELSos.environ.get("SUNO_USE_SMALL_MODELS", True)
7.抄一个newbie.py文件
from bark import SAMPLE_RATE, generate_audio, preload_models
#模型文件大约8g,约一个小时
from IPython.display import Audio
preload_models()
text_prompt = """
Hi,I'm Mike,uh — and I like pizza [laughs]
我也能讲普通话, 希望各位小可爱们多多点赞噢!
"""
audio_array = generate_audio(text_prompt)
Audio(audio_array, rate=SAMPLE_RATE)
from scipy.io.wavfile import write as write_wav
write_wav("~/audio.wav", SAMPLE_RATE, audio_array)
运行