flowchart-to-text / device_config.py
Venkat V
changed to use gpu if applicable
c2717d6
raw
history blame contribute delete
224 Bytes
# device_config.py
import torch
def get_device():
if torch.cuda.is_available():
return "cuda"
elif torch.backends.mps.is_available():
return "mps" # For Apple Silicon
else:
return "cpu"