
# Ensuring echo is on
echo "Please make sure that the default Python version is 3.10.x"

git clone https://github.com/THUDM/CogVLM

cd CogVLM

python -m pip install --upgrade pip

echo "Composing venv"
if [ ! -d "venv" ]; then
    python -m venv venv
else
    echo "venv folder already exists, skipping making new venv..."
fi

# Activate the virtual environment
source ./venv/bin/activate

echo "Installing torch"

pip3 install torch==2.2.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

echo "Installing bitsandbytes"

pip install bitsandbytes

echo "Installing triton-2.1.0"

pip install triton

echo "Installing requirements"

pip install deepspeed

pip install SwissArmyTransformer
pip install transformers==4.37.2
pip install xformers==0.0.24
pip install spacy
pip install pillow

pip install seaborn
pip install loguru==0.7.2
pip install streamlit
pip install timm
pip install accelerate
pip install pydantic

python -m spacy download en_core_web_sm

pip install gradio
pip install jsonlines
pip install apex

echo "All install completed. Please verify no errors."
# Pause in a bash script could be achieved with `read` if needed, but typically you just let the script end.
# read -p "Press enter to continue"
