Spaces:
Sleeping
Sleeping
File size: 1,729 Bytes
501847e | 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 56 57 58 59 | #!/bin/bash
echo "π Setting up AI Article Summarizer Web App"
echo "============================================="
# Create project structure
echo "π Creating project structure..."
mkdir -p templates static/audio static/summaries
# Create requirements.txt
echo "π Creating requirements.txt..."
cat > requirements.txt << EOF
Flask==2.3.3
torch>=2.0.0
transformers>=4.30.0
trafilatura>=1.6.0
soundfile>=0.12.1
kokoro>=0.9.2
librosa>=0.10.0
numpy>=1.24.0
scipy>=1.10.0
EOF
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo "π Creating virtual environment..."
python3 -m venv venv
fi
echo "π Activating virtual environment..."
source venv/bin/activate
echo "π¦ Installing Python packages..."
pip install --upgrade pip
pip install -r requirements.txt
# Install system dependencies (macOS)
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "π Installing espeak for macOS..."
if ! command -v brew &> /dev/null; then
echo "β Homebrew not found. Please install Homebrew first:"
echo " /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""
exit 1
fi
brew install espeak
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "π§ Installing espeak for Linux..."
sudo apt-get update && sudo apt-get install -y espeak-ng
fi
echo "β
Setup complete!"
echo ""
echo "π To run the web application:"
echo " 1. Activate virtual environment: source venv/bin/activate"
echo " 2. Run the app: python app.py"
echo " 3. Open http://localhost:5000 in your browser"
echo ""
echo "π Note: The first run will download AI models (~1.2GB)"
echo "β±οΈ Model loading may take 1-2 minutes on first startup" |