Spaces:
Running
Running
File size: 1,166 Bytes
905b8ff c8d287d 905b8ff c8d287d c7b063e 905b8ff c8d287d c7b063e 3e6e915 c8d287d 1b1eb9f c8d287d 1b1eb9f c8d287d 1b1eb9f c8d287d |
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 |
#!/bin/bash
set -e # Stop script immediately on error
echo "π Starting Hugging Face Space build"
echo "------------------------------------"
# Step 1 β Upgrade pip
echo "β¬οΈ Upgrading pip..."
python -m pip install --upgrade pip
# Step 2 β Install Python dependencies
if [ -f requirements.txt ]; then
echo "π¦ Installing dependencies from requirements.txt..."
pip install --no-cache-dir -r requirements.txt
else
echo "β ERROR: requirements.txt not found in repo root!"
exit 1
fi
# Step 3 β Create cache/temp directories
echo "π Creating cache and temp directories..."
mkdir -p model_cache tmp
chmod -R 777 model_cache tmp
# Step 4 β Verify moviepy installation
echo "π Verifying moviepy installation..."
python - << 'EOF'
try:
import moviepy.editor
print("β
moviepy is installed and working")
except ImportError as e:
print("β moviepy is NOT installed!")
raise e
EOF
# Step 5 β Show installed packages
echo "------------------------------------"
echo "π Installed Python packages:"
pip list
echo "------------------------------------"
echo "β
Build complete β environment ready to launch!" |