Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -541,10 +541,12 @@ import traceback
|
|
| 541 |
|
| 542 |
def get_device():
|
| 543 |
if torch.cuda.is_available():
|
| 544 |
-
|
| 545 |
-
|
|
|
|
|
|
|
| 546 |
else:
|
| 547 |
-
print(
|
| 548 |
return torch.device('cpu')
|
| 549 |
|
| 550 |
device = get_device()
|
|
|
|
| 541 |
|
| 542 |
def get_device():
|
| 543 |
if torch.cuda.is_available():
|
| 544 |
+
device = torch.device('cuda')
|
| 545 |
+
print(f"Using GPU: {torch.cuda.get_device_name(0)}")
|
| 546 |
+
print(f"GPU Memory: {torch.cuda.get_device_properties(0).total_memory / 1e9:.2f} GB")
|
| 547 |
+
return device
|
| 548 |
else:
|
| 549 |
+
print("Using CPU")
|
| 550 |
return torch.device('cpu')
|
| 551 |
|
| 552 |
device = get_device()
|