Running PyTorch + Huggingface on Apple Silicon (M1)

How do I run PyTorch and Huggingface models on Apple Silicon (M1) GPU? This traditional way doesn’t seem to work

import torch
device = torch.cuda.current_device() if torch.cuda.is_available() else 'cpu'
print(f"device: {device}")

in my very recent expirience with trying to run Huggingface and others on apple m1, there is an option to use device called ‘mps’ in place of cuda and cpy. However it falls behind in support.
General MPS op coverage tracking issue · Issue #77764 · pytorch/pytorch · GitHub - oficial issue tracker for MPS is here.