Download gmnet/code/journal_exp/scripts/run_e4_alignment.sh from YFanwang/Backup: direct link, hf CLI and curl.
- Browser
- Download file 820 Bytes
-
https://huggingface.co/datasets/YFanwang/Backup/resolve/main/gmnet/code/journal_exp/scripts/run_e4_alignment.sh
- Command line
-
hf download hf://datasets/YFanwang/Backup/gmnet/code/journal_exp/scripts/run_e4_alignment.sh
-
curl -L -o run_e4_alignment.sh https://huggingface.co/datasets/YFanwang/Backup/resolve/main/gmnet/code/journal_exp/scripts/run_e4_alignment.sh
820 Bytes
| set -euo pipefail | |
| : "${RUN_NAME:?RUN_NAME is required}" | |
| : "${OUTPUT_DIR:?OUTPUT_DIR is required}" | |
| EXPECTED_OUTPUT_DIR="/nfs/ywang29/GmNet/runs/e4_alignment/${RUN_NAME}" | |
| if [[ "${RUN_NAME}" != e4a_* ]]; then | |
| echo "E4 alignment run name must use the e4a_ namespace: ${RUN_NAME}" >&2 | |
| exit 2 | |
| fi | |
| if [[ "${OUTPUT_DIR}" != "${EXPECTED_OUTPUT_DIR}" ]]; then | |
| echo "E4 alignment output mismatch: expected ${EXPECTED_OUTPUT_DIR}, got ${OUTPUT_DIR}" >&2 | |
| exit 2 | |
| fi | |
| if ! command -v flock >/dev/null 2>&1; then | |
| echo "flock is required to prevent concurrent writers" >&2 | |
| exit 1 | |
| fi | |
| mkdir -p "${OUTPUT_DIR}" | |
| LOCK_PATH="${OUTPUT_DIR}/.e4_alignment.lock" | |
| exec 9>"${LOCK_PATH}" | |
| if ! flock -n 9; then | |
| echo "Another process is already writing ${OUTPUT_DIR}" >&2 | |
| exit 73 | |
| fi | |
| bash scripts/init_run.sh "$@" | |