Text Extraction Done, UI Fixes Done, Extracted Template Layout Saved in DB
This commit is contained in:
@@ -4,11 +4,20 @@
|
||||
cd "$(dirname "$0")/backend" || exit
|
||||
|
||||
# Activate the virtual environment
|
||||
if [ -d "venv" ]; then
|
||||
echo "Activating virtual environment..."
|
||||
source venv/bin/activate
|
||||
else
|
||||
echo "Warning: Virtual environment 'venv' not found. Attempting to run without it..."
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "Creating virtual environment 'venv'..."
|
||||
python3 -m venv venv
|
||||
fi
|
||||
|
||||
echo "Activating virtual environment..."
|
||||
source venv/bin/activate
|
||||
|
||||
# Auto-install dependencies if crucial modules are missing
|
||||
if ! python -c "import uvicorn, numpy, cv2, pdf2image" &>/dev/null; then
|
||||
echo "Dependencies missing. Installing python dependencies..."
|
||||
pip install --upgrade pip --quiet
|
||||
pip install -r requirements.txt
|
||||
echo "Dependencies installed ✓"
|
||||
fi
|
||||
|
||||
# Run the FastAPI server
|
||||
|
||||
Reference in New Issue
Block a user