Fix #2 to help with testing packages

This commit is contained in:
Ashwin Bharambe 2024-08-08 13:05:47 -07:00
parent 83adaae09b
commit 6441b78aac

View file

@ -8,7 +8,7 @@
LLAMA_MODELS_DIR=${LLAMA_MODELS_DIR:-}
LLAMA_TOOLCHAIN_DIR=${LLAMA_TOOLCHAIN_DIR:-}
USE_TEST_PYPI=${USE_TEST_PYPI:-}
TEST_PYPI_VERSION=${TEST_PYPI_VERSION:-}
set -euo pipefail
@ -57,12 +57,11 @@ ensure_conda_env_python310() {
eval "$(conda shell.bash hook)"
conda deactivate && conda activate "${env_name}"
PIP_ARGS=""
if [ "$USE_TEST_PYPI" = "1" ]; then
if [ -n "$TEST_PYPI_VERSION" ]; then
# these packages are damaged in test-pypi, so install them first
pip install fastapi libcst
PIP_ARGS="--extra-index-url https://test.pypi.org/simple/"
fi
pip install --extra-index-url https://test.pypi.org/simple/ llama-toolchain==$TEST_PYPI_VERSION $pip_dependencies
else
# Re-installing llama-toolchain in the new conda environment
if [ -n "$LLAMA_TOOLCHAIN_DIR" ]; then
if [ ! -d "$LLAMA_TOOLCHAIN_DIR" ]; then
@ -92,6 +91,7 @@ ensure_conda_env_python310() {
echo "Installing pip dependencies: $pip_dependencies"
pip install $PIP_ARGS $pip_dependencies
fi
fi
}
if [ "$#" -ne 3 ]; then