undertheradar commited on
Commit
6236a60
·
verified ·
1 Parent(s): 7a8f20f

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +8 -0
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()