diff --git a/ldm/dream/devices.py b/ldm/dream/devices.py index 9008f7871c..240754dd36 100644 --- a/ldm/dream/devices.py +++ b/ldm/dream/devices.py @@ -4,7 +4,7 @@ def choose_torch_device() -> str: '''Convenience routine for guessing which GPU device to run model on''' if torch.cuda.is_available(): return 'cuda' - if torch.backends.mps.is_available(): + if hasattr(torch.backends, 'mps') and torch.backends.mps.is_available(): return 'mps' return 'cpu'