import spaces import gradio as gr import torch @spaces.GPU def gpu_hello(): return f"Hello from ZeroGPU. CUDA visible: {torch.cuda.is_available()}, device count: {torch.cuda.device_count()}" with gr.Blocks(title="ZeroGPU dev-mode test") as demo: gr.Markdown("# ZeroGPU dev-mode test") btn = gr.Button("Ping GPU") out = gr.Textbox(label="Result") btn.click(gpu_hello, outputs=out) demo.launch()