valhalla commited on
Commit
ddb7a7a
1 Parent(s): fb1b05e

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +1 -1
server.py CHANGED
@@ -26,7 +26,7 @@ if not os.path.exists(result_path):
26
  result_path = download(url, root)
27
 
28
 
29
- device = "cpu"
30
  model = Dalle.from_pretrained(result_path) # This will automatically download the pretrained model.
31
  model.to(device=device)
32
  model_clip, preprocess_clip = clip.load("ViT-B/32", device=device)
 
26
  result_path = download(url, root)
27
 
28
 
29
+ device = "cuda" if torch.cuda.is_available() else "cpu"
30
  model = Dalle.from_pretrained(result_path) # This will automatically download the pretrained model.
31
  model.to(device=device)
32
  model_clip, preprocess_clip = clip.load("ViT-B/32", device=device)