-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnpicklingError during Bark Voice Cloning #456
Comments
Not all functionality supports Torch 2.6 yet
…On Wed, Mar 5, 2025, 10:38 AM sitzbrau ***@***.***> wrote:
*Description:*
I've encountered an error while using the Bark voice cloning feature. The
error occurs when I try to generate the voice after loading a voice sample.
*Steps to Reproduce:*
- Start the WebUI.
- Go to the "Bark Voice Clone" tab.
- Load a voice sample.
- Click on "Generate Voice".
*Actual Result:*
The following error is displayed:
Traceback (most recent call last):
File "/home/silviodpe/.local/lib/python3.10/site-packages/gradio/queueing.py", line 624, in process_events
response = await route_utils.call_process_api(
File "/home/silviodpe/.local/lib/python3.10/site-packages/gradio/route_utils.py", line 323, in call_process_api
output = await app.get_blocks().process_api(
File "/home/silviodpe/.local/lib/python3.10/site-packages/gradio/blocks.py", line 2015, in process_api
result = await self.call_function(
File "/home/silviodpe/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1562, in call_function
prediction = await anyio.to_thread.run_sync( # type: ignore
File "/home/silviodpe/.local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/home/silviodpe/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
return await future
File "/home/silviodpe/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 962, in run
result = context.run(func, *args)
File "/home/silviodpe/.local/lib/python3.10/site-packages/gradio/utils.py", line 865, in wrapper
response = f(*args, **kwargs)
File "/home/silviodpe/tts-generation-webui/tts_webui/bark/clone/tab_voice_clone.py", line 253, in generate_voice
full_generation = get_prompts(wav_file, use_gpu)
File "/home/silviodpe/tts-generation-webui/tts_webui/bark/clone/tab_voice_clone.py", line 97, in get_prompts
semantic_prompt = get_semantic_prompt(wav_file, use_gpu)
File "/home/silviodpe/tts-generation-webui/tts_webui/bark/clone/tab_voice_clone.py", line 91, in get_semantic_vectors
semantic_vectors = get_semantic_vectors(path_to_wav, device)
File "/home/silviodpe/tts-generation-webui/tts_webui/bark/clone/tab_voice_clone.py", line 53, in get_semantic_vectors
hubert_model = _load_hubert_model(device)
File "/home/silviodpe/tts-generation-webui/tts_webui/bark/clone/tab_voice_clone.py", line 33, in _load_hubert_model
hubert_model = CustomHubert(
File "/home/silviodpe/.local/lib/python3.10/site-packages/bark_hubert_quantizer/pre_kmeans_hubert.py", line 60, in __init__
checkpoint = torch.load(checkpoint_path, map_location=device)
File "/home/silviodpe/.local/lib/python3.10/site-packages/torch/serialization.py", line 1470, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.
(1) In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
(2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message.
WeightsUnpickler error: Unsupported global: GLOBAL argparse.Namespace was not an allowed global by default. Please use `torch.serialization.add_safe_globals([Namespace])` or the `torch.serialization.safe_globals([Namespace])` context manager to allowlist this global if you trust this class/function.
Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
*Expected Result:*
The voice cloning process should complete successfully without errors.
*Environment:*
Operating System: [Ubuntu 22.04]
Python Version: [Python 3.10.12]
*Additional Information:*
If you need any further details or logs, please let me know.
—
Reply to this email directly, view it on GitHub
<#456>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTRXI5HKMUZAAS6MQIJRAD2S2ZXFAVCNFSM6AAAAABYLPJXXCVHI2DSMVQWIX3LMV43ASLTON2WKOZSHA4TMNRSG4YTMMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
[image: sitzbrau]*sitzbrau* created an issue
(rsxdalv/tts-generation-webui#456)
<#456>
*Description:*
I've encountered an error while using the Bark voice cloning feature. The
error occurs when I try to generate the voice after loading a voice sample.
*Steps to Reproduce:*
- Start the WebUI.
- Go to the "Bark Voice Clone" tab.
- Load a voice sample.
- Click on "Generate Voice".
*Actual Result:*
The following error is displayed:
Traceback (most recent call last):
File "/home/silviodpe/.local/lib/python3.10/site-packages/gradio/queueing.py", line 624, in process_events
response = await route_utils.call_process_api(
File "/home/silviodpe/.local/lib/python3.10/site-packages/gradio/route_utils.py", line 323, in call_process_api
output = await app.get_blocks().process_api(
File "/home/silviodpe/.local/lib/python3.10/site-packages/gradio/blocks.py", line 2015, in process_api
result = await self.call_function(
File "/home/silviodpe/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1562, in call_function
prediction = await anyio.to_thread.run_sync( # type: ignore
File "/home/silviodpe/.local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/home/silviodpe/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
return await future
File "/home/silviodpe/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 962, in run
result = context.run(func, *args)
File "/home/silviodpe/.local/lib/python3.10/site-packages/gradio/utils.py", line 865, in wrapper
response = f(*args, **kwargs)
File "/home/silviodpe/tts-generation-webui/tts_webui/bark/clone/tab_voice_clone.py", line 253, in generate_voice
full_generation = get_prompts(wav_file, use_gpu)
File "/home/silviodpe/tts-generation-webui/tts_webui/bark/clone/tab_voice_clone.py", line 97, in get_prompts
semantic_prompt = get_semantic_prompt(wav_file, use_gpu)
File "/home/silviodpe/tts-generation-webui/tts_webui/bark/clone/tab_voice_clone.py", line 91, in get_semantic_vectors
semantic_vectors = get_semantic_vectors(path_to_wav, device)
File "/home/silviodpe/tts-generation-webui/tts_webui/bark/clone/tab_voice_clone.py", line 53, in get_semantic_vectors
hubert_model = _load_hubert_model(device)
File "/home/silviodpe/tts-generation-webui/tts_webui/bark/clone/tab_voice_clone.py", line 33, in _load_hubert_model
hubert_model = CustomHubert(
File "/home/silviodpe/.local/lib/python3.10/site-packages/bark_hubert_quantizer/pre_kmeans_hubert.py", line 60, in __init__
checkpoint = torch.load(checkpoint_path, map_location=device)
File "/home/silviodpe/.local/lib/python3.10/site-packages/torch/serialization.py", line 1470, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.
(1) In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
(2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message.
WeightsUnpickler error: Unsupported global: GLOBAL argparse.Namespace was not an allowed global by default. Please use `torch.serialization.add_safe_globals([Namespace])` or the `torch.serialization.safe_globals([Namespace])` context manager to allowlist this global if you trust this class/function.
Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
*Expected Result:*
The voice cloning process should complete successfully without errors.
*Environment:*
Operating System: [Ubuntu 22.04]
Python Version: [Python 3.10.12]
*Additional Information:*
If you need any further details or logs, please let me know.
—
Reply to this email directly, view it on GitHub
<#456>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTRXI5HKMUZAAS6MQIJRAD2S2ZXFAVCNFSM6AAAAABYLPJXXCVHI2DSMVQWIX3LMV43ASLTON2WKOZSHA4TMNRSG4YTMMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
what do you recomend to clone a voice? |
So you can either downgrade torch to use this or you can use a more modern
solution (Bark is a bit old), such as Parler TTS, MARS5, F5-TTS, StyleTTS2
(some of these might not have voice cloning within this tts-webui)
…On Wed, Mar 5, 2025 at 1:06 PM sitzbrau ***@***.***> wrote:
Not all functionality supports Torch 2.6 yet
… <#m_-1113823783371403606_>
what do you recomend to clone a voice?
—
Reply to this email directly, view it on GitHub
<#456 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTRXI6C6C3JYVOGANUHFPD2S3LEXAVCNFSM6AAAAABYLPJXXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBQGU4TINZVGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: sitzbrau]*sitzbrau* left a comment
(rsxdalv/tts-generation-webui#456)
<#456 (comment)>
Not all functionality supports Torch 2.6 yet
… <#m_-1113823783371403606_>
what do you recomend to clone a voice?
—
Reply to this email directly, view it on GitHub
<#456 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTRXI6C6C3JYVOGANUHFPD2S3LEXAVCNFSM6AAAAABYLPJXXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBQGU4TINZVGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description:
I've encountered an error while using the Bark voice cloning feature. The error occurs when I try to generate the voice after loading a voice sample.
Steps to Reproduce:
Actual Result:
The following error is displayed:
Expected Result:
The voice cloning process should complete successfully without errors.
Environment:
Operating System: [Ubuntu 22.04]
Python Version: [Python 3.10.12]
Additional Information:
If you need any further details or logs, please let me know.
The text was updated successfully, but these errors were encountered: