"""Minimal ZeroGPU probe (diagnostics only).""" import os import spaces import torch import gradio as gr _t = torch.zeros(4).to("cuda") @spaces.GPU(duration=20) def gpu_probe() -> str: """Report the GPU visible to the ZeroGPU worker.""" return f"{torch.cuda.get_device_name()} | {_t.device} | torch {torch.__version__}" with gr.Blocks() as demo: b = gr.Button("probe") o = gr.Textbox() b.click(gpu_probe, outputs=o, api_name="gpu_probe") demo.launch()