bark
bark copied to clipboard
Running example, hangs and then is killed
It hangs for a long time. Only output is:
$ python3.8 demo.py Killed
Any ideas? It's a Google Cloud instance.
$ uname -r 4.19.0-23-cloud-amd64
which demo file is this? does it come from a fork or what does it contain?
It's the first demo from the README
Edit: I also tried removing workbook audio playback (the last line) to see if that was the problem, no dice.
Here's the complete file
$ cat demo.py
from bark import SAMPLE_RATE, generate_audio, preload_models
from IPython.display import Audio
from scipy.io.wavfile import write as write_wav
# 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)
which Google Cloud instance type is this? CPU or GPU? If you run preload_models() by itself does it still crash?
Machine configuration
Machine type n1-standard-1 CPU platform Intel Skylake Architecture — vCPUs to core ratio
—
Custom visible cores — Display device Disabled Enable to use screen capturing and recording tools GPUs 1 x NVIDIA T4
Seems to hang in the same way when only preload_models() is included.
A bad dependency? Is there a docker image out there for running bark?
don't you need to turn this into a proper script to run it? have you tried running it in a notebook or ipython?
what does proper script mean
hm, actually can you just try running it in ipython or a notebook and see what happens? wondering if you are for some reason just not seeing the logging messages that download the models etc.
---instance-1:/opt/repos/bark$ ipython
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.13.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]:
In [1]: from bark import SAMPLE_RATE, generate_audio, preload_models
...: from IPython.display import Audio
...: from scipy.io.wavfile import write as write_wav
...:
...: # 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)
No GPU being used. Careful, inference might be very slow!
Killed
Maybe getting it to use a GPU (different instance) might help?
would definitely make it faster. on cpu it can take minutes or longer per sample
gonna close for inactivity. feel free to reopen if not fixed
I am getting the same issue. I do not know why it is killed.
I successfully ran it 2 times, but starting from the 3rd attempt it hangs and is killed. I am also running on CPU without a discreet GPU on this laptop.
I experienced the same issue when running Bark on GCP, and I resolved it by increasing the amount of RAM to 16 GB.
Also, when running Bark, you'll quickly run out of storage, so also keep an eye on that.
About that, do you know of a way to clear the allocated storage? When using a GPU I could clear the allocated memory as well as reduce the model sizes and that resolved my issues. I do not know how to do that for CPU runs, I can reduce the model sizes, but clearing them after I am done generating an audio file is where I'm stuck at.