#!/bin/bash # Update package lists apt-get update && apt-get upgrade -y # Install Python and pip apt-get install -y python3 python3-pip python3-venv # Create a virtual environment python3 -m venv venv source venv/bin/activate # Upgrade pip and setuptools pip install --upgrade pip setuptools wheel # Install GPU-related dependencies (optional, commented out by default) # Uncomment if you're using a GPU-enabled space # pip install nvidia-cuda-nvrtc-cu11 nvidia-cuda-runtime-cu11 nvidia-cuda-cupti-cu11 # Install core Python libraries pip install pandas==2.2.1 \ numpy==1.26.3 # Install Machine Learning and Deep Learning libraries pip install torch==2.2.1 \ transformers==4.38.1 \ datasets==2.17.1 \ accelerate==0.26.1 # Install Web Framework pip install streamlit==1.31.1 # Install additional dependencies pip install protobuf==4.25.3 \ typing-extensions==4.10.0 # Optional: Verify installations pip list echo "Setup complete! Virtual environment is activated and all dependencies are installed."