Spaces:
Running on Zero
Running on Zero
Download startup_probe.py from SOLRICKS/3D-Animation-Style-MiniMax-H3: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/SOLRICKS/3D-Animation-Style-MiniMax-H3/resolve/main/startup_probe.py
- Command line
-
hf download hf://spaces/SOLRICKS/3D-Animation-Style-MiniMax-H3/startup_probe.py
-
curl -L -o startup_probe.py https://huggingface.co/spaces/SOLRICKS/3D-Animation-Style-MiniMax-H3/resolve/main/startup_probe.py
1.14 kB
| """Temporary, weight-free startup and ZeroGPU allocation check.""" | |
| print('[probe] Python entered startup_probe.py', flush=True) | |
| import spaces | |
| print('[probe] spaces imported', flush=True) | |
| import gradio as gr | |
| print('[probe] Gradio imported', flush=True) | |
| def check_gpu(): | |
| import torch | |
| value = torch.ones(4, device='cuda').sum().item() | |
| device = torch.cuda.get_device_properties(0) | |
| return (f'GPU check passed: {device.name}; ' | |
| f'{device.total_memory / 2**30:.1f} GiB; CUDA {torch.version.cuda}; tensor sum {value:.0f}.') | |
| with gr.Blocks(title='SOLRICKS H3 startup check') as demo: | |
| gr.Markdown('# 3D Animation Style MiniMax H3\nTemporary startup check in progress.') | |
| result = gr.Textbox(label='Startup result', value='Python and Gradio started successfully.', interactive=False) | |
| button = gr.Button('Check ZeroGPU', variant='primary') | |
| button.click(check_gpu, outputs=result, api_name='check_gpu', concurrency_limit=1) | |
| print('[probe] launching lightweight Gradio interface', flush=True) | |
| if __name__ == '__main__': | |
| demo.queue().launch(show_error=True) | |