patrjfjfkfr commited on
Commit
c30bba4
Β·
verified Β·
1 Parent(s): 2c04793

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -1,6 +1,10 @@
1
- import torch
 
2
 
3
- if torch.cuda.is_available():
4
- print("βœ… CUDA is live, GPU acquired:", torch.cuda.get_device_name(0))
5
- else:
6
- print("❌ No GPU available.")
 
 
 
 
1
+ mport torch
2
+ import gradio as gr
3
 
4
+ def check_gpu(_):
5
+ if torch.cuda.is_available():
6
+ return f"βœ… GPU detected: {torch.cuda.get_device_name(0)}"
7
+ else:
8
+ return "❌ No GPU yet. Try refreshing."
9
+
10
+ gr.Interface(fn=check_gpu, inputs="text", outputs="text").launch()