Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dSupertramp opened this issue Nov 14, 2024 · 0 comments
Open

Comments

@dSupertramp
Copy link

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)

@dSupertramp dSupertramp changed the title Placeholder storage has not been allocated on MPS - device Placeholder storage has not been allocated on MPS device - Mac M2 Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant