Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,11 +4,11 @@ from transformers import pipeline
|
|
4 |
|
5 |
# Detect if a GPU is available
|
6 |
if torch.cuda.is_available():
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
|
13 |
# Print device info (this will be logged in Hugging Face Spaces container)
|
14 |
if torch.cuda.is_available():
|
|
|
4 |
|
5 |
# Detect if a GPU is available
|
6 |
if torch.cuda.is_available():
|
7 |
+
device = "cuda"
|
8 |
+
print("has cuda.")
|
9 |
+
else:
|
10 |
+
device = "cpu"
|
11 |
+
print("no cuda.")
|
12 |
|
13 |
# Print device info (this will be logged in Hugging Face Spaces container)
|
14 |
if torch.cuda.is_available():
|