import spaces import torch import gradio as gr @spaces.GPU def check(): return f"CUDA available: {torch.cuda.is_available()}\nDevice: {torch.cuda.get_device_name(0)}" gr.Interface(fn=check, inputs=[], outputs="text").launch()