IDEFICS3_ROCOv2 / start.sh
none
wip
e235434
raw
history blame
1.04 kB
#!/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 '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 "$@"