bark icon indicating copy to clipboard operation
bark copied to clipboard

Does this work in vs-code for local development ?

Open drjkpalli opened this issue 1 year ago • 8 comments

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'

drjkpalli avatar Apr 29 '23 01:04 drjkpalli

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

peremarshall avatar Apr 29 '23 05:04 peremarshall

Yep. That was the issue. Thanks @peremarshall

drjkpalli avatar Apr 29 '23 06:04 drjkpalli

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 ??

drjkpalli avatar Apr 29 '23 06:04 drjkpalli

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

rubinchyk avatar Apr 29 '23 17:04 rubinchyk

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.

DizzyDJW avatar Apr 30 '23 11:04 DizzyDJW

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

mcamac avatar May 02 '23 16:05 mcamac

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?

DizzyDJW avatar May 02 '23 16:05 DizzyDJW

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.

MovLab2 avatar May 04 '23 20:05 MovLab2

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

gkucsko avatar May 11 '23 18:05 gkucsko

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: @.***>

MovLab2 avatar May 11 '23 21:05 MovLab2