Download gpu_probe.py from roccot/LIBE: direct link, hf CLI and curl.
- Browser
- Download file 738 Bytes
-
https://huggingface.co/spaces/roccot/LIBE/resolve/main/gpu_probe.py
- Command line
-
hf download hf://spaces/roccot/LIBE/gpu_probe.py
-
curl -L -o gpu_probe.py https://huggingface.co/spaces/roccot/LIBE/resolve/main/gpu_probe.py
738 Bytes
| """Temporary isolation test: set app_file: gpu_probe.py in Space README.""" | |
| import spaces | |
| import torch | |
| import gradio as gr | |
| from importlib.metadata import version | |
| print(f"Probe runtime: torch={torch.__version__}, cuda_build={torch.version.cuda}, spaces={version('spaces')}", flush=True) | |
| def test_gpu(): | |
| print("GPU probe worker entered", flush=True) | |
| result = (torch.ones(1, device='cuda') + 1).cpu().item() | |
| return f"GPU works: {torch.cuda.get_device_name(0)}; result={result}" | |
| demo = gr.Interface(fn=test_gpu, inputs=[], outputs='text', title='ZeroGPU allocation test') | |
| demo.queue(default_concurrency_limit=1).launch( | |
| server_name="0.0.0.0", | |
| server_port=7860, | |
| prevent_thread_lock=False, | |
| ) | |