Skip to content
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

[Bug] Bark fails in non-root environment #3608

Closed
egdels opened this issue Feb 26, 2024 · 6 comments · Fixed by idiap/coqui-ai-TTS#253
Closed

[Bug] Bark fails in non-root environment #3608

egdels opened this issue Feb 26, 2024 · 6 comments · Fixed by idiap/coqui-ai-TTS#253
Labels
bug Something isn't working wontfix This will not be worked on but feel free to help.

Comments

@egdels
Copy link

egdels commented Feb 26, 2024

Describe the bug

On Debian 12 with python 3.11 and tts 0.22.0 running command

tts --model_name tts_models/multilingual/multi-dataset/bark --list_speaker_idxs

as non-root fails with error:

PermissionError: [Errno 13] Permission denied: '/root/.local'

Screenshot:

grafik

To Reproduce

  1. python3 -m venv path/to/venv
  2. source path/to/venv/bin/activate
  3. pip install tts
  4. tts --model_name tts_models/multilingual/multi-dataset/bark --list_speaker_idxs
  5. model is downloaded, but when model should be loaded see error.

Expected behavior

tts should download model and then list available speakers

Logs

> Downloading model to /home/christian/.local/share/tts/tts_models--multilingual--multi-dataset--bark
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.93G/3.93G [09:24<00:00, 6.97MiB/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.74G/3.74G [08:56<00:00, 6.97MiB/s]
 31%|█████████████████████████████████████████████████████                                                                                                                      | 9.00/29.0 [00:00<00:00, 27.8iB/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.11k/6.11k [00:00<00:00, 13.1kiB/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.14G/1.14G [02:43<00:00, 6.97MiB/s]
  0%|                                                                                                                                                                                  | 0.00/104M [00:00<?, ?iB/s > Model's license - MIT███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌| 104M/104M [00:14<00:00, 7.11MiB/s]
 > Check https://choosealicense.com/licenses/mit/ for more info.
 > Using model: bark
/home/christian/git/path/to/venv/lib/python3.11/site-packages/torch/nn/utils/weight_norm.py:28: UserWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.
  warnings.warn("torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.")
WARNING:TTS.tts.layers.bark.load_model:found outdated text model, removing...
Traceback (most recent call last):
  File "/home/christian/git/path/to/venv/bin/tts", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/christian/git/path/to/venv/lib/python3.11/site-packages/TTS/bin/synthesize.py", line 423, in main
    synthesizer = Synthesizer(
                  ^^^^^^^^^^^^
  File "/home/christian/git/path/to/venv/lib/python3.11/site-packages/TTS/utils/synthesizer.py", line 109, in __init__
    self._load_tts_from_dir(model_dir, use_cuda)
  File "/home/christian/git/path/to/venv/lib/python3.11/site-packages/TTS/utils/synthesizer.py", line 164, in _load_tts_from_dir
    self.tts_model.load_checkpoint(config, checkpoint_dir=model_dir, eval=True)
  File "/home/christian/git/path/to/venv/lib/python3.11/site-packages/TTS/tts/models/bark.py", line 281, in load_checkpoint
    self.load_bark_models()
  File "/home/christian/git/path/to/venv/lib/python3.11/site-packages/TTS/tts/models/bark.py", line 50, in load_bark_models
    self.semantic_model, self.config = load_model(
                                       ^^^^^^^^^^^
  File "/home/christian/git/path/to/venv/lib/python3.11/site-packages/TTS/tts/layers/bark/load_model.py", line 119, in load_model
    _download(config.REMOTE_MODEL_PATHS[model_type]["path"], ckpt_path, config.CACHE_DIR)
  File "/home/christian/git/path/to/venv/lib/python3.11/site-packages/TTS/tts/layers/bark/load_model.py", line 49, in _download
    os.makedirs(CACHE_DIR, exist_ok=True)
  File "<frozen os>", line 215, in makedirs
  File "<frozen os>", line 215, in makedirs
  File "<frozen os>", line 215, in makedirs
  [Previous line repeated 1 more time]
  File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/root/.local'

Environment

python collect_env_info.py
{
    "CUDA": {
        "GPU": [],
        "available": false,
        "version": "12.1"
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "2.2.1+cu121",
        "TTS": "0.22.0",
        "numpy": "1.26.4"
    },
    "System": {
        "OS": "Linux",
        "architecture": [
            "64bit",
            "ELF"
        ],
        "processor": "",
        "python": "3.11.2",
        "version": "#1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30)"
    }
}

Additional context

No response

@egdels egdels added the bug Something isn't working label Feb 26, 2024
@yoller
Copy link

yoller commented Mar 24, 2024

Hi, I have a practically similar problem but on macOS, any solutions?

EDIT
I found this: #2781 (comment)

Copy link

stale bot commented May 11, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.

@stale stale bot added the wontfix This will not be worked on but feel free to help. label May 11, 2024
@stale stale bot closed this as completed Jun 26, 2024
@carlosmatthews
Copy link

same issue on terminal ubuntu on wsl windows, non-root fails with error:

PermissionError: [Errno 13] Permission denied: '/root/.local'

@hykilpikonna
Copy link

You can edit these in ~/.local/share/tts/tts_models--multilingual--multi-dataset--bark/config.json

image

@hykilpikonna
Copy link

I'm honestly 🤯 by how /root is hardcoded in the config 🤦🏼‍♀️

@eginhard
Copy link
Contributor

This is now fixed in our fork, available via pip install coqui-tts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on but feel free to help.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants