Spaces:
Running
Running
File size: 1,545 Bytes
833dac3 |
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 |
#!/bin/bash
# Script to start the Educational LLM Application
# Color definitions
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Welcome message
echo -e "${GREEN}=== Educational LLM Application Startup Script ===${NC}"
echo -e "${YELLOW}Setting up environment...${NC}"
# Check Python3 exists
if ! command -v python3 &> /dev/null; then
echo "Error: Python3 not found. Please install Python3 first."
exit 1
fi
# Create virtual environment (if it doesn't exist)
if [ ! -d "venv" ]; then
echo -e "${YELLOW}Creating virtual environment...${NC}"
python3 -m venv venv
if [ $? -ne 0 ]; then
echo "Error: Unable to create virtual environment. Please check your Python installation."
exit 1
fi
fi
# Activate virtual environment
echo -e "${YELLOW}Activating virtual environment...${NC}"
source venv/bin/activate
if [ $? -ne 0 ]; then
echo "Error: Unable to activate virtual environment."
exit 1
fi
# Check requirements.txt and install dependencies
echo -e "${YELLOW}Installing dependencies...${NC}"
pip install -r requirements.txt
if [ $? -ne 0 ]; then
echo "Error: Unable to install dependencies. Please check your network connection and requirements.txt file."
exit 1
fi
# Ensure cache directory exists
echo -e "${YELLOW}Creating cache directory...${NC}"
mkdir -p cache
# Start application
echo -e "${GREEN}Starting Educational LLM Application...${NC}"
echo -e "${YELLOW}The application will open in your browser${NC}"
python app.py
# Exit virtual environment
deactivate |