Update README.md

#1
by gouldj2 - opened
Files changed (1) hide show
  1. README.md +1 -1
README.md CHANGED
@@ -102,7 +102,7 @@ class PerImageNormalize(nn.Module):
102
 
103
 
104
  # Load model
105
- device = "cuda"
106
  model = AutoModel.from_pretrained("CaicedoLab/MorphEm", trust_remote_code=True)
107
  model.to(device).eval()
108
 
 
102
 
103
 
104
  # Load model
105
+ device = "cuda" if torch.cuda.is_available() else "cpu"
106
  model = AutoModel.from_pretrained("CaicedoLab/MorphEm", trust_remote_code=True)
107
  model.to(device).eval()
108