Spaces:
Build error
Build error
CB commited on
Update postBuild
Browse files
postBuild
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
|
|
| 1 |
#!/usr/bin/env bash
|
| 2 |
set -e
|
| 3 |
|
| 4 |
# Install system ffmpeg (ensures ffmpeg binary available for ffmpeg-python and yt-dlp)
|
| 5 |
-
apt-get update && apt-get install -y ffmpeg
|
| 6 |
|
| 7 |
# Upgrade pip
|
| 8 |
pip install --upgrade pip
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# pip install torch==2.2.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
# Show installed versions for debugging
|
| 15 |
echo "Python: $(python --version)"
|
| 16 |
echo "pip: $(pip --version)"
|
| 17 |
echo "ffmpeg: $(ffmpeg -version | head -n 1)"
|
|
|
|
|
|
|
|
|
| 1 |
+
# postBuild
|
| 2 |
#!/usr/bin/env bash
|
| 3 |
set -e
|
| 4 |
|
| 5 |
# Install system ffmpeg (ensures ffmpeg binary available for ffmpeg-python and yt-dlp)
|
| 6 |
+
apt-get update && apt-get install -y ffmpeg git git-lfs
|
| 7 |
|
| 8 |
# Upgrade pip
|
| 9 |
pip install --upgrade pip
|
| 10 |
|
| 11 |
+
# Install main Python requirements
|
| 12 |
+
pip install -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# Clone and install phi and phi-vision (install from source to avoid zip/archive 404 issues)
|
| 15 |
+
TMP_DIR=$(mktemp -d)
|
| 16 |
+
git clone https://github.com/lukasruff/phi.git "$TMP_DIR/phi" --depth 1 || (echo "Failed to clone phi"; exit 1)
|
| 17 |
+
git clone https://github.com/lukasruff/phi-vision.git "$TMP_DIR/phi-vision" --depth 1 || (echo "Failed to clone phi-vision"; exit 1)
|
| 18 |
+
|
| 19 |
+
pip install "$TMP_DIR/phi"
|
| 20 |
+
pip install "$TMP_DIR/phi-vision"
|
| 21 |
+
|
| 22 |
+
# (Optional) Install CPU-only PyTorch if phi requires it — uncomment if phi installation errors mention torch.
|
| 23 |
# pip install torch==2.2.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
|
| 24 |
|
| 25 |
+
# Cleanup
|
| 26 |
+
rm -rf "$TMP_DIR"
|
| 27 |
+
|
| 28 |
# Show installed versions for debugging
|
| 29 |
echo "Python: $(python --version)"
|
| 30 |
echo "pip: $(pip --version)"
|
| 31 |
echo "ffmpeg: $(ffmpeg -version | head -n 1)"
|
| 32 |
+
python -c "import phi; print('phi:', getattr(phi, '__version__', 'unknown'))" || true
|
| 33 |
+
python -c "import phi_vision as pv; print('phi-vision:', getattr(pv, '__version__', 'unknown'))" || true
|