代码拉取完成,页面将自动刷新
#!/bin/bash
# upload weights to cache
upload() {
echo "Received a SIGTERM or SIGKILL signal. Uploading to cache."
object_id="${MODEL_ID//\//--}"
S3_DIRECTORY="models--$object_id"
aws configure set default.s3.preferred_transfer_client crt
aws configure set default.s3.payload_signing_enabled false
aws configure set default.s3.target_bandwidth 50Gb/s
echo "running aws s3 sync /data/${S3_DIRECTORY}/ s3://${HF_CACHE_BUCKET}/${S3_DIRECTORY}/ --exclude blobs/* --exclude *.bin"
aws s3 sync "/data/${S3_DIRECTORY}/" "s3://${HF_CACHE_BUCKET}/${S3_DIRECTORY}/" --exclude "blobs/*" --exclude "*.bin"
exit 0
}
# Trap SIGTERM signals and call the cleanup function
trap upload SIGTERM SIGKILL
# print AWS CLI version
aws --version
# download files
time ./sync.sh
# Function to check if lorax-launcher is running
is_launcher_running() {
local launcher_pid="$1"
# this checks whether the process is alive or not. Redirects the output of kill -0 to devnull.
kill -0 "$launcher_pid" >/dev/null 2>&1
}
# launch TG launcher in the background
lorax-launcher "$@" &
# Capture the PID of the process we just launched
launcher_pid="$!"
# Loop to continuously check if lorax-launcher is running
while is_launcher_running "$launcher_pid"; do
sleep 1
done
# Once lorax-launcher has stopped, the loop exits, and upload is called
upload
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。