meetara / setup_space.sh
rameshbasina's picture
Fix HF Spaces build: Pin Python 3.12 for spacy wheel compatibility
c01f4e7
#!/bin/bash
# Setup script for HF Space
# Installs pre-built llama-cpp-python wheel to avoid compilation timeout
echo "πŸš€ Setting up meeTARA Space..."
# Install pre-built llama-cpp-python wheel (avoids 30+ min compilation)
echo "πŸ“¦ Installing pre-built llama-cpp-python wheel..."
# Try to find and install a compatible pre-built wheel
# For Python 3.10 on Linux x86_64
PYTHON_VERSION=$(python -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')")
ARCH=$(uname -m)
# Try installing from PyPI with --only-binary flag first (uses wheel if available)
pip install --no-cache-dir --only-binary :all: llama-cpp-python==0.3.16 2>/dev/null || {
echo "⚠️ Pre-built wheel not found on PyPI, trying alternative sources..."
# Try installing from GitHub releases (if available)
pip install --no-cache-dir llama-cpp-python==0.3.16 || {
echo "❌ Failed to install llama-cpp-python. Build will continue but may fail at runtime."
}
}
# Note: spaCy removed from requirements due to Python 3.13 compatibility issues
# Domain detection uses keyword matching instead
echo "βœ… Setup complete!"