plane-mode-scholar / scripts /run_autotrain.py
PMS Sync
Deploy 000b308 (flattened for HF Spaces)
4577459
Raw
History Blame Contribute Delete
1.24 kB
#!/usr/bin/env python3
"""
Deprecated — HF AutoTrain was replaced by Unsloth for the Well-Tuned badge.
This script forwards to scripts/run_unsloth_finetune.py so old docs/commands still work.
Usage:
python scripts/run_unsloth_finetune.py # preferred
python scripts/run_autotrain.py # alias (this file)
"""
from __future__ import annotations
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def _map_args(argv: list[str]) -> list[str]:
mapped: list[str] = []
skip_next = False
for i, arg in enumerate(argv):
if skip_next:
skip_next = False
continue
if arg == "--local":
continue
if arg == "--skip-push":
mapped.append("--skip-dataset-push")
continue
if arg == "--backend":
skip_next = True
continue
mapped.append(arg)
return mapped
def main() -> int:
target = ROOT / "scripts" / "run_unsloth_finetune.py"
print("Note: AutoTrain → Unsloth. See docs/finetune.md")
cmd = [sys.executable, str(target), *_map_args(sys.argv[1:])]
return subprocess.call(cmd)
if __name__ == "__main__":
raise SystemExit(main())