Last active
September 9, 2024 18:37
-
-
Save imaitland/4408f82852c41484712c287b778f07f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Get the absolute path of the script | |
SCRIPT_PATH="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" | |
# Set OLLAMA_MODELS environment variable | |
export OLLAMA_MODELS="$SCRIPT_PATH/models" | |
# Add SCRIPT_PATH/bin/ollama to the PATH if it's not already included | |
OLLAMA_BIN="$SCRIPT_PATH/bin" | |
if [[ ":$PATH:" != *":$OLLAMA_BIN:"* ]]; then | |
export PATH="$PATH:$OLLAMA_BIN" | |
echo "Added $OLLAMA_BIN to PATH" | |
else | |
echo "$OLLAMA_BIN is already in PATH" | |
fi | |
# Print information | |
echo "ollama added to system PATH, run 'ollama serve' to get started" | |
echo "ollama will look for models in: $OLLAMA_MODELS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
s/o @ryanhausen for this script