Spaces:
Runtime error
Runtime error
Commit
·
190d9e9
1
Parent(s):
a0e846a
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
-
import torch
|
| 2 |
import streamlit as st
|
| 3 |
-
|
| 4 |
-
from PIL import Image
|
| 5 |
|
| 6 |
-
|
| 7 |
-
pipe = pipe.to("cuda")
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import torch
|
|
|
|
| 3 |
|
| 4 |
+
st.title("Hugging Face Space GPU Info")
|
|
|
|
| 5 |
|
| 6 |
+
# Check if GPU is available
|
| 7 |
+
gpu_available = torch.cuda.is_available()
|
| 8 |
|
| 9 |
+
if gpu_available:
|
| 10 |
+
gpu_name = torch.cuda.get_device_name(0)
|
| 11 |
+
st.write(f"GPU available: {gpu_name}")
|
| 12 |
+
else:
|
| 13 |
+
st.write("No GPU available")
|