Download scripts/modal_smoke.py from debudash/slm-training: direct link, hf CLI and curl.
- Browser
- Download file 690 Bytes
-
https://huggingface.co/debudash/slm-training/resolve/main/scripts/modal_smoke.py
- Command line
-
hf download hf://debudash/slm-training/scripts/modal_smoke.py
-
curl -L -o modal_smoke.py https://huggingface.co/debudash/slm-training/resolve/main/scripts/modal_smoke.py
690 Bytes
| """Check Modal can give us a GPU and read the Hugging Face secret. Run: modal run scripts/modal_smoke.py""" | |
| import modal | |
| app = modal.App("slm-training-smoke") | |
| def gpu_info(): | |
| import os | |
| import subprocess | |
| gpu = subprocess.run( | |
| ["nvidia-smi", "--query-gpu=name,memory.total", "--format=csv,noheader"], | |
| capture_output=True, text=True, | |
| ).stdout.strip() | |
| return gpu, bool(os.environ.get("HF_TOKEN")) | |
| def main(): | |
| gpu, has_token = gpu_info.remote() | |
| print(f"GPU: {gpu} | HF_TOKEN visible in container: {has_token}") | |