Concrete_creep_predict / start_app.sh
Sompote's picture
Upload 13 files
dda35dd verified
#!/bin/bash
echo "πŸ—οΈ Enhanced Concrete Creep Prediction App - Startup Script"
echo "=========================================================="
# Check if Python is installed
if ! command -v python &> /dev/null; then
echo "❌ Python is not installed. Please install Python 3.8 or higher."
exit 1
fi
# Check Python version
PYTHON_VERSION=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
echo "🐍 Python version: $PYTHON_VERSION"
# Check if pip is installed
if ! command -v pip &> /dev/null; then
echo "❌ pip is not installed. Please install pip."
exit 1
fi
# Install dependencies
echo "πŸ“¦ Installing dependencies..."
pip install -r requirements.txt
if [ $? -ne 0 ]; then
echo "❌ Failed to install dependencies. Please check requirements.txt"
exit 1
fi
echo "βœ… Dependencies installed successfully!"
# Check if model files exist
if [ ! -f "best_llm_model-17.pt" ] && [ ! -f "final_llm_model-5.pt" ]; then
echo "❌ No model files found. Please ensure model files are present."
exit 1
fi
# Check if scalers directory exists
if [ ! -d "scalers" ]; then
echo "❌ Scalers directory not found. Please ensure scalers directory is present."
exit 1
fi
echo "βœ… All files verified!"
echo "πŸš€ Starting Streamlit app..."
echo ""
echo "The app will be available at:"
echo " Local URL: http://localhost:8501"
echo " Network URL: http://$(hostname -I | awk '{print $1}'):8501"
echo ""
echo "Press Ctrl+C to stop the application"
echo ""
# Start the Streamlit app
streamlit run app.py