Skip to content

Commit

Permalink
Fix init.sh to load requirements properly if not run in the api direc…
Browse files Browse the repository at this point in the history
…tory
  • Loading branch information
dadmobile committed Feb 22, 2024
1 parent c8c1559 commit 2055a26
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# -e: Exit immediately on error. -u: treat unset variables as an error and exit immediately.
set -eu

# Need the directory of this script to reference other files
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

OS=$(uname -s)
ARCH=$(uname -m)

Expand Down Expand Up @@ -82,13 +85,13 @@ if [ "$HAS_GPU" = true ] ; then

echo "Installing requirements:"
# Install the python requirements
pip install -r requirements.txt
pip install -r $SCRIPT_DIR/requirements.txt
else
echo "No NVIDIA GPU detected drivers detected. Install NVIDIA drivers to enable GPU support."
echo "https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#pre-installation-actions"
echo "Installing Tranformer Lab requirements without GPU support"

pip install -r requirements-no-gpu.txt
pip install -r $SCRIPT_DIR/requirements-no-gpu.txt
fi

# Deactivate the environment when done
Expand Down

0 comments on commit 2055a26

Please sign in to comment.