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.05k stars 406 forks source link

ModuleNotFoundError: No module named 'hubert' #35

Open tralala87 opened 1 year ago

tralala87 commented 1 year ago

When trying to run 'clone_voice.ipynb', I get:

ModuleNotFoundError Traceback (most recent call last) in <cell line: 1>() ----> 1 from hubert.hubert_manager import HuBERTManager 2 hubert_manager = HuBERTManager() 3 hubert_manager.make_sure_hubert_installed() 4 hubert_manager.make_sure_tokenizer_installed()

ModuleNotFoundError: No module named 'hubert'

dagshub[bot] commented 1 year ago

Join the discussion on DagsHub!

RealUnrealGameDev commented 1 year ago

Hey Im still getting this error any way to fix??

randywreed commented 1 year ago

You have to install the hubert manager. Do the following:

git clone https://github.com/gitmylo/bark-voice-cloning-HuBERT-quantizer/  
cd bark-voice-cloning-HuBERT-quantizer
pip install -r requirements.txt
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117   

It should now run (This works for me in a colab notebook, I have not tested it from a cli, YMMV)

tralala87 commented 1 year ago

Now I get this error: ModuleNotFoundError: No module named 'bark.generation'

RahulBhalley commented 1 year ago

Oh, it's simple!

git clone https://github.com/serp-ai/bark-with-voice-clone
cd bark-with-voice-clone/
pip install git+https://github.com/suno-ai/bark.git

Now 'hubert' module will be available. :)

vvonchain commented 1 year ago

still getting no module named hubert

BrasD99 commented 1 year ago

still getting no module named hubert

@vvonchain, seems like they changed name of folder. Look at https://github.com/gitmylo/bark-voice-cloning-HuBERT-quantizer/tree/master/bark_hubert_quantizer So simply change hubert to bark_hubert_quantizer

Take a look at my pull request: https://github.com/serp-ai/bark-with-voice-clone/pull/51

And here is my notebook in google colab: https://colab.research.google.com/drive/1fW6-RfcIX4wZ0T5Fc0B-M_3a459L3qaW?usp=sharing

PSY222 commented 1 year ago

from bark_hubert_quantizer.hubert_manager import HuBERTManager As @BrasD99 mentioned, directory is renamed. This simple line solved my issue. Likewise, just replace all of 'hubert' to 'bark_hubert_quantizer!

souvikqb commented 1 year ago

still getting no module named hubert

@vvonchain, seems like they changed name of folder. Look at https://github.com/gitmylo/bark-voice-cloning-HuBERT-quantizer/tree/master/bark_hubert_quantizer So simply change hubert to bark_hubert_quantizer

Take a look at my pull request: #51

And here is my notebook in google colab: https://colab.research.google.com/drive/1fW6-RfcIX4wZ0T5Fc0B-M_3a459L3qaW?usp=sharing

Hi, I was trying to Clone an audio file using this Notebook, but the process seems to be very slow for some reason. I am using NVIDIA 4090 with 24GB vRAM

BrasD99 commented 1 year ago

Hi, I was trying to Clone an audio file using this Notebook, but the process seems to be very slow for some reason. I am using NVIDIA 4090 with 24GB vRAM

@souvikqb Hi, I'm not a contributor to this repository. But it takes a long time for me too. You are using a gpu, so I think you need to load the appropriate models for it, so change this flags:

preload_models(
    text_use_gpu=False, # -> To True
    text_use_small=False,
    coarse_use_gpu=False, # -> To True
    coarse_use_small=False,
    fine_use_gpu=False, # -> To True
    fine_use_small=False,
    codec_use_gpu=False, # -> To True
    force_reload=False
)
souvikqb commented 1 year ago

Hi, I was trying to Clone an audio file using this Notebook, but the process seems to be very slow for some reason. I am using NVIDIA 4090 with 24GB vRAM

@souvikqb Hi, I'm not a contributor to this repository. But it takes a long time for me too. You are using a gpu, so I think you need to load the appropriate models for it, so change this flags:

preload_models(
    text_use_gpu=False, # -> To True
    text_use_small=False,
    coarse_use_gpu=False, # -> To True
    coarse_use_small=False,
    fine_use_gpu=False, # -> To True
    fine_use_small=False,
    codec_use_gpu=False, # -> To True
    force_reload=False
)

Thank you so much, that solved it.

I was wondering if there was a way to increase the output quality somehow. ?

Currently, the cloning works, but is there any way to make it better or any parameters to play with?

BrasD99 commented 1 year ago

Currently, the cloning works, but is there any way to make it better or any parameters to play with?

I can't help here because I've run into problems myself. Сan't even get any satisfactory results. I can’t clone the Russian voice at all, the output is random English speech. And no one answers my issue ;( But I'm glad you got the preliminary results!

UPD: i fixed my notebook.

thedarkknight197 commented 10 months ago

Hi, I was trying to Clone an audio file using this Notebook, but the process seems to be very slow for some reason. I am using NVIDIA 4090 with 24GB vRAM

@souvikqb Hi, I'm not a contributor to this repository. But it takes a long time for me too. You are using a gpu, so I think you need to load the appropriate models for it, so change this flags:

preload_models(
    text_use_gpu=False, # -> To True
    text_use_small=False,
    coarse_use_gpu=False, # -> To True
    coarse_use_small=False,
    fine_use_gpu=False, # -> To True
    fine_use_small=False,
    codec_use_gpu=False, # -> To True
    force_reload=False
)

Thank you so much, that solved it.

I was wondering if there was a way to increase the output quality somehow. ?

Currently, the cloning works, but is there any way to make it better or any parameters to play with?

But how can i load my new voice created with my specific voice name?

gustrd commented 9 months ago

Hi, I was trying to Clone an audio file using this Notebook, but the process seems to be very slow for some reason. I am using NVIDIA 4090 with 24GB vRAM

@souvikqb Hi, I'm not a contributor to this repository. But it takes a long time for me too. You are using a gpu, so I think you need to load the appropriate models for it, so change this flags:

preload_models(
    text_use_gpu=False, # -> To True
    text_use_small=False,
    coarse_use_gpu=False, # -> To True
    coarse_use_small=False,
    fine_use_gpu=False, # -> To True
    fine_use_small=False,
    codec_use_gpu=False, # -> To True
    force_reload=False
)

Thank you so much, that solved it. I was wondering if there was a way to increase the output quality somehow. ? Currently, the cloning works, but is there any way to make it better or any parameters to play with?

But how can i load my new voice created with my specific voice name?

You need to use a .npz file to save the cloned voice and then load it at the library aftwerwards.

You can find more info here: https://github.com/suno-ai/bark/issues/379