Skip to content

Placeholder storage has not been allocated on MPS device - Mac M2 #613

@dSupertramp

Description

@dSupertramp

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions