2023-12-05 08:15:37 +01:00
|
|
|
#!/bin/bash
|
2024-03-01 16:48:53 -05:00
|
|
|
set -ex
|
2023-12-05 08:15:37 +01:00
|
|
|
|
|
|
|
export PATH=$PATH:/opt/conda/bin
|
|
|
|
|
2024-03-07 14:37:45 +01:00
|
|
|
if [ "$BUILD_TYPE" != "cublas" ]; then
|
|
|
|
echo "[exllama] Attention!!! Nvidia GPU is required - skipping installation"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2024-03-01 16:48:53 -05:00
|
|
|
# Check if environment exist
|
|
|
|
conda_env_exists(){
|
|
|
|
! conda list --name "${@}" >/dev/null 2>/dev/null
|
|
|
|
}
|
2023-12-05 08:15:37 +01:00
|
|
|
|
2024-03-01 16:48:53 -05:00
|
|
|
if conda_env_exists "exllama" ; then
|
|
|
|
echo "Creating virtual environment..."
|
|
|
|
conda env create --name exllama --file $1
|
|
|
|
echo "Virtual environment created."
|
|
|
|
else
|
|
|
|
echo "Virtual environment already exists."
|
|
|
|
fi
|
2023-12-05 08:15:37 +01:00
|
|
|
|
2024-03-01 16:48:53 -05:00
|
|
|
source activate exllama
|
2023-12-05 08:15:37 +01:00
|
|
|
|
|
|
|
git clone https://github.com/turboderp/exllama $CONDA_PREFIX/exllama && pushd $CONDA_PREFIX/exllama && pip install -r requirements.txt && popd
|
|
|
|
|
2024-01-08 00:37:02 +01:00
|
|
|
cp -rfv $CONDA_PREFIX/exllama/* ./
|
|
|
|
|
|
|
|
if [ "$PIP_CACHE_PURGE" = true ] ; then
|
|
|
|
pip cache purge
|
|
|
|
fi
|