slm-training / scripts /modal_smoke.py
debudash's picture
Mirror slm-training at 4376283
4643f62 verified
Raw History Blame Contribute Delete
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")
@app.function(gpu="L40S", timeout=300, secrets=[modal.Secret.from_name("huggingface")])
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"))
@app.local_entrypoint()
def main():
gpu, has_token = gpu_info.remote()
print(f"GPU: {gpu} | HF_TOKEN visible in container: {has_token}")