NameError: name 'VOCOS_ENABLED' is not defined when using bark #367

Closed
opened 2023-09-03 10:40:49 +00:00 by Rochikus · 2 comments

When trying to generate voice on bark backend I'm getting this error:

[1/1] Generating line: Hello, this is model testing.
Traceback (most recent call last):
  File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 1075, in process_api
    result = await self.call_function(
  File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 884, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\gradio\helpers.py", line 587, in tracked_fn
    response = fn(*args)
  File "G:\Programs Fast\ai-voice-cloning\src\webui.py", line 94, in generate_proxy
    raise e
  File "G:\Programs Fast\ai-voice-cloning\src\webui.py", line 88, in generate_proxy
    sample, outputs, stats = generate(**kwargs)
  File "G:\Programs Fast\ai-voice-cloning\src\utils.py", line 354, in generate
    return generate_bark(**kwargs)
  File "G:\Programs Fast\ai-voice-cloning\src\utils.py", line 496, in generate_bark
    gen = tts.inference(cut_text, **settings )
  File "G:\Programs Fast\ai-voice-cloning\src\utils.py", line 302, in inference
    if VOCOS_ENABLED:
NameError: name 'VOCOS_ENABLED' is not defined

It happens both on random and custom voices. I tried slicing audio as in other issue potential solution, but it didn't help. I tried reinstalling everything. Installed whole app under python 3.10 instead of 3.9 after some dependencies issues on vall-e install, and also I have visual studio build tools installed to solve some wheel issues I had before, so there should be no dependencies issues. Also, yes everything was installed after toroise, under venv and admin.
When I lauch bark I have this message:

(venv) G:\Programs Fast\ai-voice-cloning>start.bat --tts-backend="bark"

(venv) G:\Programs Fast\ai-voice-cloning>call .\venv\Scripts\activate.bat
Whisper detected
No module named 'deepspeed'
VALL-E detected
Bark detected
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Loading Bark...
Vocos detected
Traceback (most recent call last):
  File "G:\Programs Fast\ai-voice-cloning\src\utils.py", line 174, in __init__
    from hubert.hubert_manager import HuBERTManager
ModuleNotFoundError: No module named 'hubert'

Loaded TTS, ready for generation.

Btw would like to know what is the module "hubert", is it important?
But as I see vocos is present, also I have it installed in the pip list.

When trying to generate voice on bark backend I'm getting this error: ``` [1/1] Generating line: Hello, this is model testing. Traceback (most recent call last): File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict output = await app.get_blocks().process_api( File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 1075, in process_api result = await self.call_function( File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 884, in call_function prediction = await anyio.to_thread.run_sync( File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run result = context.run(func, *args) File "G:\Programs Fast\ai-voice-cloning\venv\lib\site-packages\gradio\helpers.py", line 587, in tracked_fn response = fn(*args) File "G:\Programs Fast\ai-voice-cloning\src\webui.py", line 94, in generate_proxy raise e File "G:\Programs Fast\ai-voice-cloning\src\webui.py", line 88, in generate_proxy sample, outputs, stats = generate(**kwargs) File "G:\Programs Fast\ai-voice-cloning\src\utils.py", line 354, in generate return generate_bark(**kwargs) File "G:\Programs Fast\ai-voice-cloning\src\utils.py", line 496, in generate_bark gen = tts.inference(cut_text, **settings ) File "G:\Programs Fast\ai-voice-cloning\src\utils.py", line 302, in inference if VOCOS_ENABLED: NameError: name 'VOCOS_ENABLED' is not defined ``` It happens both on random and custom voices. I tried slicing audio as in other issue potential solution, but it didn't help. I tried reinstalling everything. Installed whole app under python 3.10 instead of 3.9 after some dependencies issues on vall-e install, and also I have visual studio build tools installed to solve some wheel issues I had before, so there should be no dependencies issues. Also, yes everything was installed after toroise, under venv and admin. When I lauch bark I have this message: ``` (venv) G:\Programs Fast\ai-voice-cloning>start.bat --tts-backend="bark" (venv) G:\Programs Fast\ai-voice-cloning>call .\venv\Scripts\activate.bat Whisper detected No module named 'deepspeed' VALL-E detected Bark detected Running on local URL: http://127.0.0.1:7860 To create a public link, set `share=True` in `launch()`. Loading Bark... Vocos detected Traceback (most recent call last): File "G:\Programs Fast\ai-voice-cloning\src\utils.py", line 174, in __init__ from hubert.hubert_manager import HuBERTManager ModuleNotFoundError: No module named 'hubert' Loaded TTS, ready for generation. ``` Btw would like to know what is the module "hubert", is it important? But as I see vocos is present, also I have it installed in the pip list.
Owner

Should be fixed in commit 7fc8f4c45a. I remembered I might have flubbered it up during cleanup of trying to make initialization faster (which was just from having a ton of voices in the voice folder), but it should be fixed.

HuBERT may or may not be helpful, I only have borrowed code from the serp-ai/bark-with-voice-clone repo that uses it too, but the voice cloning aspect still didn't seem to work when I last tried it.

*Should* be fixed in commit 7fc8f4c45a2fbf259ae1ad6ca903752446d9e8be. I remembered I might have flubbered it up during cleanup of trying to make initialization faster (which was just from having a ton of voices in the voice folder), but it should be fixed. HuBERT may or may not be helpful, I only have borrowed code from the [serp-ai/bark-with-voice-clone](https://github.com/serp-ai/bark-with-voice-clone) repo that uses it too, but the voice cloning aspect still didn't seem to work when I last tried it.
Author

Tested it, now it works! Thanks!
Tho the quality of the voice is not that impressive as I thought, hope it can be finetuned as easy as tortoise!
Now I need to try dall-e and see how it works.

UPD: seems bark is not finetunable

Tested it, now it works! Thanks! Tho the quality of the voice is not that impressive as I thought, hope it can be finetuned as easy as tortoise! Now I need to try dall-e and see how it works. UPD: seems bark is not finetunable
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrq/ai-voice-cloning#367
No description provided.