rag-bajaj / startup.sh
quantumbit's picture
Upload 41 files
5ff6b14 verified
#!/bin/bash
echo "=== RAG System Startup ==="
# Check if RAG/rag_embeddings directory exists
if [ -d "RAG/rag_embeddings" ]; then
echo "βœ… RAG/rag_embeddings directory found"
# Copy database files to writable /tmp directory
echo "πŸ“ Copying databases to writable location..."
mkdir -p /tmp/rag_embeddings
cp -r RAG/rag_embeddings/* /tmp/rag_embeddings/
# Remove any lock files from the copied databases
find /tmp/rag_embeddings -name "*.lock" -delete 2>/dev/null || true
find /tmp/rag_embeddings -name "*.db-shm" -delete 2>/dev/null || true
find /tmp/rag_embeddings -name "*.db-wal" -delete 2>/dev/null || true
# Set environment variable to use writable location
export RAG_EMBEDDINGS_PATH="/tmp/rag_embeddings"
echo "βœ… Databases copied to writable location: /tmp/rag_embeddings"
else
echo "❌ RAG/rag_embeddings directory not found"
fi
echo "βœ… Database directories ready"
# Start the application
echo "πŸš€ Starting RAG API..."
python app.py