suno-ai / bark

🔊 Text-Prompted Generative Audio Model
MIT License
36.27k stars 4.27k forks source link

Does this work in vs-code for local development ? #206

Closed drjkpalli closed 1 year ago

drjkpalli commented 1 year ago

Hi, was not able to use the following code to generate the audio:

from bark import SAMPLE_RATE, generate_audio, preload_models
from IPython.display import Audio

# download and load all models
preload_models()

# generate audio from text
text_prompt = """
     Hello, my name is Suno. And, uh — and I like pizza. [laughs] 
     But I also have other interests such as playing tic tac toe.
"""
audio_array = generate_audio(text_prompt)

# play text in notebook
Audio(audio_array, rate=SAMPLE_RATE)

Got the following errror:

No GPU being used. Careful, inference might be very slow!
Traceback (most recent call last):
  File "/Users/jk/Library/CloudStorage/OneDrive-Personal/Medical AI/Test/test2.py", line 5, in <module>
    preload_models()
  File "/usr/local/lib/python3.10/site-packages/bark/generation.py", line 341, in preload_models
    _ = load_model(
  File "/usr/local/lib/python3.10/site-packages/bark/generation.py", line 298, in load_model
    model = _load_model_f(ckpt_path, device)
  File "/usr/local/lib/python3.10/site-packages/bark/generation.py", line 234, in _load_model
    _download(model_info["repo_id"], model_info["file_name"], ckpt_path)
  File "/usr/local/lib/python3.10/site-packages/bark/generation.py", line 168, in _download
    hf_hub_download(repo_id=from_hf_path, filename=file_name, local_dir=CACHE_DIR)
  File "/usr/local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
    return fn(*args, **kwargs)
TypeError: hf_hub_download() got an unexpected keyword argument 'local_dir'
peremarshall commented 1 year ago

The issue might be caused by an outdated version of the huggingface_hub library, @drjkpalli.

To fix the issue, please try updating the huggingface_hub library:

pip install -U huggingface_hub

drjkpalli commented 1 year ago

Yep. That was the issue. Thanks @peremarshall

drjkpalli commented 1 year ago

I am working with cpu only on a 2015 13 inch MacBook Pro with 8gb of ram. Any suggestions on what the best approach is with regards to the models or otherwise ??

rubinchyk commented 1 year ago

The issue might be caused by an outdated version of the huggingface_hub library, @drjkpalli.

To fix the issue, please try updating the huggingface_hub library:

pip install -U huggingface_hub

Unfortunately same situation and this not helped.

P.S. This helped https://github.com/suno-ai/bark/issues/173

DizzyDJW commented 1 year ago

Yea... I've tried every so-called "Fix" and I still can't get around that obnoxious error "found outdated text model, removing"

EVERY. SINGLE. FIX. has failed. Not even ChatGPT could rectify the issue. At this point I'm ready to remove the 20+GBs of useless junk I've downloaded in an attempt to get this to function. 16GB in the .cache folder alone.

mcamac commented 1 year ago

Apologies, we are debugging some issues with the new download method which we think is related to this.

DizzyDJW commented 1 year ago

Apologies, we are debugging some issues with the new download method which we think is related to this.

Will it require a fresh download and install? I.E. Should I just delete the files on my computer and try again or will it be best to keep the several different ".pt" files I had to download individually, manually?

MovLab2 commented 1 year ago

FIXED

similar issue

\anaconda3\lib\site-packages\bark\generation.py", line 168, in _download hf_hub_download(repo_id=from_hf_path, filename=file_name, local_dir=CACHE_DIR) TypeError: hf_hub_download() got an unexpected keyword argument 'local_dir'

EDIT I fixed it by installing "pip install git+https://github.com/huggingface/huggingface_hub" Got the 'bark_generation.wav' wave file after a very long wait. CPU only... link was from here = https://huggingface.co/docs/huggingface_hub/installation

Install from source In some cases, it is interesting to install huggingface_hub directly from source. This allows you to use the bleeding edge main version rather than the latest stable version. The main version is useful for staying up-to-date with the latest developments, for instance if a bug has been fixed since the last official release but a new release hasn’t been rolled out yet.

gkucsko commented 1 year ago

great! gonna close, feel free to reopen if not fixed for someone

MovLab2 commented 1 year ago

yes :)

-----Original Message----- From: Georg Kucsko @.> To: suno-ai/bark @.> Cc: MovLab2 @.>; Comment @.> Sent: Thu, May 11, 2023 2:13 pm Subject: Re: [suno-ai/bark] Does this work in vs-code for local development ? (Issue #206)

Closed #206 as completed.— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>