Upload scripts/run_ab_job.py with huggingface_hub
Browse files- scripts/run_ab_job.py +28 -0
scripts/run_ab_job.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Minimal launcher for the PINO 3-arm A/B GPU job on HF jobs.
|
| 2 |
+
|
| 3 |
+
Downloads the A/B driver script from the source repo and runs it. Kept tiny and
|
| 4 |
+
dependency-free (only huggingface_hub) so it can be exec'd directly as a job
|
| 5 |
+
command: python scripts/run_ab_job.py
|
| 6 |
+
"""
|
| 7 |
+
import os
|
| 8 |
+
import runpy
|
| 9 |
+
import sys
|
| 10 |
+
|
| 11 |
+
from huggingface_hub import hf_hub_download
|
| 12 |
+
|
| 13 |
+
TOKEN = os.environ["HF_TOKEN"]
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def main() -> None:
|
| 17 |
+
path = hf_hub_download(
|
| 18 |
+
"mattbitzesty/pino-source-code",
|
| 19 |
+
"scripts/hf_gpu_ab_job.py",
|
| 20 |
+
repo_type="model",
|
| 21 |
+
token=TOKEN,
|
| 22 |
+
)
|
| 23 |
+
sys.argv = ["hf_gpu_ab_job.py"]
|
| 24 |
+
runpy.run_path(path, run_name="__main__")
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
if __name__ == "__main__":
|
| 28 |
+
main()
|