Spaces:
Runtime error
Runtime error
cocktailpeanut
commited on
Commit
•
a6cc9e4
1
Parent(s):
8b1c135
mps
Browse files
app.py
CHANGED
@@ -11,7 +11,11 @@ import uuid
|
|
11 |
|
12 |
|
13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
|
14 |
dtype = torch.float16
|
|
|
|
|
15 |
|
16 |
LOW_MEMORY = os.getenv("LOW_MEMORY", "0") == "1"
|
17 |
|
|
|
11 |
|
12 |
|
13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
14 |
+
if torch.backends.mps.is_available():
|
15 |
+
device = "mps"
|
16 |
dtype = torch.float16
|
17 |
+
if device == "mps":
|
18 |
+
dtype = torch.float32
|
19 |
|
20 |
LOW_MEMORY = os.getenv("LOW_MEMORY", "0") == "1"
|
21 |
|