Spaces:
Sleeping
Sleeping
File size: 894 Bytes
1a25b7f | 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 | #!/bin/bash
set -e
echo "=== AlgoVision Two-Space Bootloader ==="
# 1. Validate Token
if [ -z "$HF_TOKEN" ]; then
echo "ERROR: The 'HF_TOKEN' environment variable is empty!"
echo "Please add a Write/Read access token under Space Settings -> Variables and secrets."
exit 1
fi
# 2. Clone Private Repository
echo "Cloning private source code from AlgoVision-Server..."
rm -rf /tmp/algo_repo
git clone --depth 1 https://oauth2:$HF_TOKEN@huggingface.co/spaces/ldsprgrm/AlgoVision-Server /tmp/algo_repo
# 3. Deploy to /app
echo "Moving private assets to active container space..."
# Copy everything (including hidden files) from /tmp/algo_repo to /app
cp -rp /tmp/algo_repo/. /app/
rm -rf /tmp/algo_repo
# 4. Set Permissions
chmod +x /app/entrypoint.sh
chmod -R 777 /app
# 5. Hand over control to native entrypoint
echo "Launching AlgoVision Application..."
exec /app/entrypoint.sh
|