File size: 477 Bytes
e05ff03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""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()