mirror of
https://github.com/mudler/LocalAI.git
synced 2025-01-22 20:38:12 +00:00
f41b7e1feb
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
31 lines
705 B
Bash
Executable File
31 lines
705 B
Bash
Executable File
#!/bin/bash
|
|
set -ex
|
|
|
|
SKIP_CONDA=${SKIP_CONDA:-0}
|
|
|
|
# Check if environment exist
|
|
conda_env_exists(){
|
|
! conda list --name "${@}" >/dev/null 2>/dev/null
|
|
}
|
|
|
|
if [ $SKIP_CONDA -eq 1 ]; then
|
|
echo "Skipping conda environment installation"
|
|
else
|
|
export PATH=$PATH:/opt/conda/bin
|
|
if conda_env_exists "parler" ; then
|
|
echo "Creating virtual environment..."
|
|
conda env create --name parler --file $1
|
|
echo "Virtual environment created."
|
|
else
|
|
echo "Virtual environment already exists."
|
|
fi
|
|
fi
|
|
|
|
if [ "$PIP_CACHE_PURGE" = true ] ; then
|
|
if [ $SKIP_CONDA -ne 1 ]; then
|
|
# Activate conda environment
|
|
source activate parler
|
|
fi
|
|
|
|
pip cache purge
|
|
fi |