Spaces:
Sleeping
Sleeping
abrakjamson
commited on
Commit
·
c50cfb4
1
Parent(s):
f7a1bd4
handle no GPU
Browse files
app.py
CHANGED
@@ -26,7 +26,8 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
26 |
)
|
27 |
model = model.to("cuda:0" if torch.cuda.is_available() else "cpu")
|
28 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
29 |
-
|
|
|
30 |
|
31 |
model = ControlModel(model, list(range(-5, -18, -1)))
|
32 |
|
|
|
26 |
)
|
27 |
model = model.to("cuda:0" if torch.cuda.is_available() else "cpu")
|
28 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
29 |
+
if torch.cuda.is_available():
|
30 |
+
print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
31 |
|
32 |
model = ControlModel(model, list(range(-5, -18, -1)))
|
33 |
|