Spaces:
Sleeping
Sleeping
| # postBuild | |
| #!/usr/bin/env bash | |
| set -e | |
| # Install system ffmpeg (ensures ffmpeg binary available for ffmpeg-python and yt-dlp) | |
| apt-get update && apt-get install -y ffmpeg git git-lfs | |
| # Upgrade pip | |
| pip install --upgrade pip | |
| # Install main Python requirements | |
| pip install -r requirements.txt | |
| # Clone and install phi and phi-vision (install from source to avoid zip/archive 404 issues) | |
| TMP_DIR=$(mktemp -d) | |
| git clone https://github.com/lukasruff/phi.git "$TMP_DIR/phi" --depth 1 || (echo "Failed to clone phi"; exit 1) | |
| git clone https://github.com/lukasruff/phi-vision.git "$TMP_DIR/phi-vision" --depth 1 || (echo "Failed to clone phi-vision"; exit 1) | |
| pip install "$TMP_DIR/phi" | |
| pip install "$TMP_DIR/phi-vision" | |
| # (Optional) Install CPU-only PyTorch if phi requires it — uncomment if phi installation errors mention torch. | |
| # pip install torch==2.2.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html | |
| # Cleanup | |
| rm -rf "$TMP_DIR" | |
| # Show installed versions for debugging | |
| echo "Python: $(python --version)" | |
| echo "pip: $(pip --version)" | |
| echo "ffmpeg: $(ffmpeg -version | head -n 1)" | |
| python -c "import phi; print('phi:', getattr(phi, '__version__', 'unknown'))" || true | |
| python -c "import phi_vision as pv; print('phi-vision:', getattr(pv, '__version__', 'unknown'))" || true | |