File size: 1,527 Bytes
0cb481f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Reusable, resumable Hugging Face release upload for liofoil/copuladock.
#
# Submit only after reviewing the staging tree. Authentication may come from
# HF_TOKEN in the submission environment or a token saved by
# `huggingface_hub.login()`; never put a token in this file.
#   sbatch upload_copuladock.sbatch
#
# If a network transfer is interrupted, submit the same script again.  Do not
# remove hf_stage_copuladock/: huggingface_hub retains its upload state there.

#SBATCH --account=bghp-delta-cpu
#SBATCH --partition=cpu
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=8
#SBATCH --mem=32G
#SBATCH --time=2-00:00:00
#SBATCH --job-name=copuladock_hf_upload
#SBATCH --output=/work/nvme/bghp/hhao/gnncp/release_copuladock/copuladock_hf_upload_%j.out
#SBATCH --error=/work/nvme/bghp/hhao/gnncp/release_copuladock/copuladock_hf_upload_%j.err
#SBATCH --open-mode=append
#SBATCH --mail-type=FAIL,END

set -Eeuo pipefail
umask 007

readonly RELEASE_ROOT=/work/nvme/bghp/hhao/gnncp/release_copuladock
readonly PYTHON=/u/hhao/anaconda3/envs/hgf/bin/python
readonly UPLOAD_WORKERS="${UPLOAD_WORKERS:-8}"

finish()
{
    local rc=$?
    echo "[$(date --iso-8601=seconds)] job=${SLURM_JOB_ID:-unknown} exit=${rc}"
}
trap finish EXIT

test -x "${PYTHON}"
test -r "${RELEASE_ROOT}/upload_copuladock.py"
echo "[$(date --iso-8601=seconds)] host=$(hostname) workers=${UPLOAD_WORKERS}"

"${PYTHON}" "${RELEASE_ROOT}/upload_copuladock.py" \
    --prepare --verify --upload --num-workers "${UPLOAD_WORKERS}"