import torch import gradio as gr def check_gpu(_): if torch.cuda.is_available(): return f"✅ GPU detected: {torch.cuda.get_device_name(0)}" else: return "❌ No GPU yet. Try refreshing." gr.Interface(fn=check_gpu, inputs="text", outputs="text").launch()