[CLI] remove dependency on CONDA_PREFIX in CLI (#144)

* remove dependency on CONDA_PREFIX in CLI

* lint

* typo

* more robust
This commit is contained in:
Xi Yan 2024-09-28 16:46:47 -07:00 committed by GitHub
parent fe460ba103
commit 6a8c2ae1df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 20 deletions

View file

@ -17,9 +17,9 @@ if [ -n "$LLAMA_MODELS_DIR" ]; then
echo "Using llama-models-dir=$LLAMA_MODELS_DIR"
fi
if [ "$#" -lt 2 ]; then
echo "Usage: $0 <distribution_type> <build_name> <pip_dependencies> [<special_pip_deps>]" >&2
echo "Example: $0 <distribution_type> mybuild 'numpy pandas scipy'" >&2
if [ "$#" -lt 3 ]; then
echo "Usage: $0 <distribution_type> <build_name> <build_file_path> <pip_dependencies> [<special_pip_deps>]" >&2
echo "Example: $0 <distribution_type> mybuild ./my-stack-build.yaml 'numpy pandas scipy'" >&2
exit 1
fi
@ -29,7 +29,8 @@ set -euo pipefail
build_name="$1"
env_name="llamastack-$build_name"
pip_dependencies="$2"
build_file_path="$2"
pip_dependencies="$3"
# Define color codes
RED='\033[0;31m'
@ -123,6 +124,9 @@ ensure_conda_env_python310() {
done
fi
fi
mv $build_file_path $CONDA_PREFIX/
echo "Build spec configuration saved at $CONDA_PREFIX/$build_name-build.yaml"
}
ensure_conda_env_python310 "$env_name" "$pip_dependencies" "$special_pip_deps"