Download code/run_bg.sh from Lucasgitguy-co/Turbo-Kev-Dictate-1.4B: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/Lucasgitguy-co/Turbo-Kev-Dictate-1.4B/resolve/main/code/run_bg.sh
- Command line
-
hf download hf://Lucasgitguy-co/Turbo-Kev-Dictate-1.4B/code/run_bg.sh
-
curl -L -o run_bg.sh https://huggingface.co/Lucasgitguy-co/Turbo-Kev-Dictate-1.4B/resolve/main/code/run_bg.sh
1.16 kB
| # run_bg.sh <name> <command...>: run a long job detached (nohup + setsid + caffeinate) so terminal/Claude restarts | |
| # can't kill it. launchd is not used: launchd jobs get "Operation not permitted" on this removable exFAT drive (no | |
| # Removable Volumes permission). Log: runs/<name>-<time>.log, ends with EXIT=<code>. PID (= process group) in | |
| # runs/<name>.pid. Save and stop training: bash run.sh stop | |
| set -euo pipefail | |
| cd "$(dirname "$0")" | |
| if [[ $# -lt 2 || ! "$1" =~ ^[a-zA-Z0-9_.-]+$ ]]; then | |
| echo "Usage: ./run_bg.sh <job-name> <command> [args...]" >&2 | |
| exit 2 | |
| fi | |
| name=$1; shift | |
| if [[ ${1##*/} == bash && ( ${2:-} == run.sh || ${2:-} == ./run.sh ) ]]; then | |
| case ${3:-} in | |
| chain|text|proj) | |
| export PYTHONPATH="$PWD" | |
| exec "${TK_PY:-$HOME/.venvs/turbo-kev-train/bin/python}" -m tk.control background "$name" "$@" | |
| ;; | |
| esac | |
| fi | |
| log="$PWD/runs/$name-$(date +%Y%m%d-%H%M%S).log" | |
| nohup perl -e 'use POSIX qw(setsid); setsid(); exec @ARGV' /bin/bash -c 'caffeinate -i "$@"; code=$?; echo EXIT=$code; exit "$code"' bash "$@" \ | |
| > "$log" 2>&1 < /dev/null & | |
| echo $! > "runs/$name.pid"; disown | |
| echo "started $name pid $! -> $log" | |