Spaces:
Paused
Paused
Download app.py from hugging-science/ZeroSSH: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/hugging-science/ZeroSSH/resolve/main/app.py
- Command line
-
hf download hf://spaces/hugging-science/ZeroSSH/app.py
-
curl -L -o app.py https://huggingface.co/spaces/hugging-science/ZeroSSH/resolve/main/app.py
1.04 kB
| import gradio as gr | |
| import spaces | |
| import torch | |
| def gpu_test(): | |
| # Placeholder for the future SSH functionality | |
| if torch.cuda.is_available(): | |
| gpu = torch.cuda.get_device_name(0) | |
| return ( | |
| "π Free SSH for ZeroGPU!\n\n" | |
| "π οΈ Dev Mode enabled\n" | |
| "π SSH access is provided through Space Dev Mode.\n" | |
| "π§ͺ GPU test is currently being used as a placeholder.\n\n" | |
| f"GPU: {gpu}" | |
| ) | |
| return ( | |
| "π Free SSH for ZeroGPU!\n\n" | |
| "π οΈ Dev Mode enabled\n" | |
| "π SSH access is provided through Space Dev Mode.\n" | |
| "π§ͺ GPU test is currently being used as a placeholder.\n\n" | |
| "No GPU allocated." | |
| ) | |
| demo = gr.Interface( | |
| fn=gpu_test, | |
| inputs=[], | |
| outputs=gr.Textbox(label="Status"), | |
| title="π Free SSH for ZeroGPU!", | |
| description=( | |
| "Hugging Face Space Dev Mode provides SSH access. " | |
| "The GPU test is only a placeholder for now." | |
| ), | |
| ) | |
| demo.launch() |