File size: 1,068 Bytes
1d75522
 
 
 
 
 
 
865ec2f
 
 
 
 
 
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
#!/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

# 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

# Start the application
echo "Starting Advanced Agentic System..."
export PYTHONPATH="${PYTHONPATH}:${PWD}"
python main.py