mkhodary101 commited on
Commit
645d766
·
verified ·
1 Parent(s): 6e2e071

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -15
app.py CHANGED
@@ -1,17 +1,6 @@
1
  import torch
2
- import gradio as gr
3
 
4
- def check_gpu():
5
- if torch.cuda.is_available():
6
- return f"✅ GPU Available: {torch.cuda.get_device_name(0)}"
7
- return "❌ GPU Not Available"
8
-
9
- iface = gr.Interface(
10
- fn=check_gpu,
11
- inputs=[],
12
- outputs="text",
13
- title="GPU Test",
14
- description="Click to check GPU availability."
15
- )
16
-
17
- iface.launch(server_name="0.0.0.0", server_port=7860, share=True, debug=True)
 
1
  import torch
 
2
 
3
+ if torch.cuda.is_available():
4
+ print("✅ GPU is available:", torch.cuda.get_device_name(0))
5
+ else:
6
+ print("❌ No GPU detected!")