Spaces:
Sleeping
Sleeping
| 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!" |