mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
add support for Apple hardware using MPS acceleration
This commit is contained in:
11
ldm/dream/devices.py
Normal file
11
ldm/dream/devices.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import torch
|
||||
|
||||
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():
|
||||
return 'mps'
|
||||
return 'cpu'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user