PABannier / bark.cpp

Suno AI's Bark model in C/C++ for fast text-to-speech
MIT License
693 stars 56 forks source link

Some broken things for first timers #71

Closed jmtatsch closed 1 year ago

jmtatsch commented 1 year ago

First of all, thanks for taking up the challenge and democratising this wunderful model.

encodec_24khz-d7cc33bc.th doesn't download for me

Downloading: "https:/dl.fbaipublicfiles.com/encodec/v0/encodec_24khz-d7cc33bc.th" to /Users/tatsch/.cache/torch/hub/checkpoints/encodec_24khz-d7cc33bc.th
Traceback (most recent call last):
  File "/Users/tatsch/workspace/bark.cpp/download_weights.py", line 41, in <module>
    state_dict = torch.hub.load_state_dict_from_url(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/torch/hub.py", line 746, in load_state_dict_from_url
    download_url_to_file(url, cached_file, hash_prefix, progress=progress)
  File "/opt/homebrew/lib/python3.11/site-packages/torch/hub.py", line 611, in download_url_to_file
    u = urlopen(req)
        ^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 516, in open
    req = meth(req)
          ^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1272, in do_request_
    raise URLError('no host given')
urllib.error.URLError: <urlopen error no host given>

curl -o models/encodec_24khz-d7cc33bc.th https://dl.fbaipublicfiles.com/encodec/v0/encodec_24khz-d7cc33bc.th

vocab.txt also isnt there for me in models, maybe related to the aforementioned issue

curl -o models/vocab.txt https://huggingface.co/suno/bark/blob/main/vocab.txt

but I guess its the wrong one because when I run it

bark_model_load: reading bark vocab
bark_vocab_load: wrong voculary size (305 != 119547)
bark_model_load: invalid model file './ggml_weights//ggml_vocab.bin' (bad text)
main: failed to load model from './ggml_weights/'

also the call in the readme should be

./main -m ./ggml_weights/ -p "this is an audio" instead of

./main -m ./models/ggml_weights/ -p "this is an audio" for the default folder structure.

Green-Sky commented 1 year ago

curl -o models/vocab.txt https://huggingface.co/suno/bark/blob/main/vocab.txt

if you look into the file, you will see that you downloaded a html site :)

use https://huggingface.co/suno/bark/raw/main/vocab.txt instead

jmtatsch commented 1 year ago

Thanks, I have noticed that as well after playing around for a while. I works now, thank you.