Spaces:
Runtime error
Runtime error
Update server.py
Browse files
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)
|