bark
bark copied to clipboard
Placeholder storage has not been allocated on MPS device - Mac M2
I'm trying to run bark on my M2, 8 gb of memory: this is the code:
from transformers import AutoProcessor, BarkModel
import torch
device = "mps" if torch.backends.mps.is_available() else "cpu"
processor = AutoProcessor.from_pretrained("suno/bark")
model = BarkModel.from_pretrained("suno/bark-small", torch_dtype=torch.float16).to(device)
voice_preset = "v2/en_speaker_6"
inputs = processor("Hello, my dog is cute", voice_preset=voice_preset)
audio_array = model.generate(**inputs)
audio_array = audio_array.cpu().numpy().squeeze()
Error:
voice_preset = "v2/en_speaker_6"
inputs = processor("Hello, my dog is cute", voice_preset=voice_preset)
audio_array = model.generate(**inputs)
audio_array = audio_array.cpu().numpy().squeeze()
RuntimeError: Placeholder storage has not been allocated on MPS device!
I also tried with:
audio_array = model.generate(**inputs).to(device)
model = BarkModel.from_pretrained("suno/bark-small", torch_dtype=torch.float32).to('cpu') can run on my mac... but anyone know how to use 'mps' ?