Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import spaces, torch, gradio as gr
|
| 2 |
+
@spaces.GPU(duration=20)
|
| 3 |
+
def info():
|
| 4 |
+
if not torch.cuda.is_available():
|
| 5 |
+
return "NO CUDA"
|
| 6 |
+
p = torch.cuda.get_device_properties(0)
|
| 7 |
+
return f"{p.name} | {p.total_memory/1024**3:.1f} GB | mp={p.major}.{p.minor}"
|
| 8 |
+
gr.Interface(fn=info, inputs=None, outputs="text", title="GPU info").launch()
|