bark
bark copied to clipboard
My graphics card has 6GB of VRAM.,but CUDA out of memory.
from bark import SAMPLE_RATE, generate_audio, preload_models from scipy.io.wavfile import write as write_wav import os
os.environ["SUNO_OFFLOAD_CPU"] = 'True' os.environ["SUNO_USE_SMALL_MODELS"] = 'True'
preload_models()
text_prompt = """ skip """ audio_array = generate_audio(text_prompt)
write_wav("w.wav", SAMPLE_RATE, audio_array)
Traceback (most recent call last):
File "D:\file\lanqiao\ba.py", line 11, in
How can I repair it?
Try my answer here https://github.com/suno-ai/bark/issues/315#issuecomment-1568127751
I figured out a solution, load modules on demand rather than load them all at the same time, try this pull request: https://github.com/suno-ai/bark/pull/531