File size: 1,056 Bytes
44fc622 e235434 44fc622 e235434 44fc622 e235434 44fc622 7971fe4 44fc622 |
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 |
#!/bin/bash
JOB_URL_SCHEME=${JOB_URL_SCHEME:-"http://"}
JOB_ID=${JOB_ID:-'localhost'}
JOB_HOST=${JOB_HOST:-'local'}
export HOME=/workspace
cd /workspace
git lfs install
if [[ -z "$HF_TOKEN" || ! "$HF_TOKEN" =~ ^hf_ ]]; then
export HF_TOKEN=${!#}
unset ${!#}
fi
echo "HF_TOKEN: $HF_TOKEN"
. /workspace/.bashrc
. /workspace/.miniconda3/bin/activate
export SHELL=/bin/bash
git clone https://huggingface.co/eltorio/IDEFICS3_ROCOv2
git config --global user.email "me@hg.co"
git config --global user.name "me@hg.co"
git config --global credential.helper store
huggingface-cli login --add-to-git-credential --token $HF_TOKEN
screen -dmS jupyter bash -c 'SHELL=/bin/bash jupyter lab --ip=0.0.0.0 --port=8080 --no-browser --allow-root \
--notebook-dir=/workspace \
--LabApp.token="" \
--LabApp.custom_display_url=${JOB_URL_SCHEME}${JOB_ID}-8080.${JOB_HOST} \
--LabApp.allow_remote_access=True \
--LabApp.allow_origin="*" \
--LabApp.disable_check_xsrf=True'
echo "Jupyter Lab is running at ${JOB_URL_SCHEME}${JOB_ID}-8080.${JOB_HOST}"
exec "$@" |