flowchart-to-text-v1 / device_config.py
Venkat V
Fresh start with clean LFS tracking
c2fb848
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"