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

How to configure for Mac silicon Intel and AMD #89

Open
ldjpr opened this issue Jun 1, 2023 · 4 comments
Open

How to configure for Mac silicon Intel and AMD #89

ldjpr opened this issue Jun 1, 2023 · 4 comments

Comments

@ldjpr
Copy link

ldjpr commented Jun 1, 2023

How can I configure to run in a Intel Mac with AMD GPU?

I get the error: "Torch not compiled with CUDA enabled"

Has anyone been able to run it?

@ediooo
Copy link

ediooo commented Jun 2, 2023 via email

@suckrowPierre
Copy link

I got it running on my M1 using the AudioLDM pipeline from HuggingSpace.

(https://huggingface.co/docs/diffusers/v0.17.1/en/api/pipelines/audioldm)

from diffusers import AudioLDMPipeline
import torch

repo_id = "cvssp/audioldm-m-full"
pipe = AudioLDMPipeline.from_pretrained(repo_id, torch_dtype=torch.float64)
# pipe = pipe.to("cude")
pipe = pipe.to("cpu")

prompt = "mystical, dreamy analog synth strings"
negative_prompt = "low quality, average quality, noisey, high pitch, artefacts"
audio = pipe(prompt=prompt, audio_length_in_s=5.0, num_inference_steps=10, guidance_scale=2.5, negative_prompt=negative_prompt).audios[0]

from IPython.display import Audio
Audio(audio, rate=44100)

with the conda dependencies:

name: audio_env
channels:
  - defaults
dependencies:
  - python=3.11.0
  - pip
  - jupyter
  - pip:
    - torch==2.0.1
    - diffusers
    - transformers

@suckrowPierre
Copy link

seems also to work and be a bit faster with
pipe = pipe.to("mps")

@dzluke
Copy link

dzluke commented Jul 17, 2023

@suckrowPierre Thanks for the code and conda env. I tried to use pipe = pipe.to("mps") but got the error
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

Did you run unto this problem at all?

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

4 participants