Spaces:
Runtime error
Runtime error
File size: 1,352 Bytes
1d75522 865ec2f 6cc7431 1d75522 6cc7431 1d75522 |
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
#!/bin/bash
# Exit on error
set -e
echo "Starting initialization..."
# Check for required environment variables
if [ -z "$GROQ_API_KEY" ]; then
echo "Error: GROQ_API_KEY is not set. Please add it as a secret in your Hugging Face space settings."
exit 1
fi
# Install system dependencies
echo "Installing system dependencies..."
apt-get update && apt-get install -y \
cmake \
ninja-build \
build-essential \
git-lfs
# Update pip and install dependencies
echo "Updating pip and installing dependencies..."
python -m pip install --upgrade pip
pip install -r requirements.txt
# Install Groq SDK
pip install groq>=0.4.1
# Verify API keys and connectivity
echo "Verifying package versions..."
python check_versions.py
if [ $? -ne 0 ]; then
echo "Error: Package version verification failed"
exit 1
fi
# Configure environment
if [ -z "$GROQ_API_KEY" ]; then
echo "Warning: GROQ_API_KEY not set. Falling back to local models."
export MODEL_BACKEND=huggingface
fi
if [ -z "$HUGGINGFACE_TOKEN" ]; then
echo "Warning: HUGGINGFACE_TOKEN not set. Some features may be limited."
fi
# Set environment variables for llama-cpp-python
export CMAKE_ARGS="-DLLAMA_CUBLAS=on"
export FORCE_CMAKE=1
# Start the application
echo "Starting Advanced Agentic System..."
export PYTHONPATH="${PYTHONPATH}:${PWD}"
python main.py
|