serp-ai / bark-with-voice-clone

🔊 Text-prompted Generative Audio Model - With the ability to clone voices
https://serp.ai/tools/bark-text-to-speech-ai-voice-clone-app
Other
3.06k stars 411 forks source link

Clone_voice.ipynb spitting out import issues for codec #1

Open MarythaV2 opened 1 year ago

MarythaV2 commented 1 year ago

I've been trying to run the clone_voice.ipynb file but I have been getting stuck at the importing of codec, but there have been some other errors after that. I have codec, but I'm getting the error message " cannot import name 'codec_encode' from 'bark.generation' ", " name 'torchaudio' is not defined ", and " name 'torch' is not defined ".

sould3mon commented 1 year ago

i would try reinstalling with followin method (windows) use powershell first check wich python is available py -0 my system example

 py -0
Installed Pythons found by C:\Windows\py.exe Launcher for Windows
 -3.10-64 *
 -3.9-64
 -3.7-64
 -3.6-64

i would suggest python 3.10.x create a fresh directory

mkdir bark-withclone cd bark-withclone py -3.10 -m venv venv .\venv\Scripts\Activate.ps1 it should look like (venv) PS G:\git\ai-audio\bark-withclone> then first instal torch with pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117 pip3 install notebook pip install soundfile pip install git+https://github.com/serp-ai/bark-with-voice-clone.git

run the following tests with ipython:

import torch
torch.cuda.is_available()

output should be True

import bark
from bark import SAMPLE_RATE, generate_audio

should return without error mkdir notebooks copy your notebook to this directory cd notebooks jupyter notebook open your notebook and try again

this is how i got it up and running hope this helps

MarythaV2 commented 1 year ago

thank you, that fixed it!