Avoid using conda run since it buffers everything

This commit is contained in:
Ashwin Bharambe 2024-08-07 22:21:38 -07:00
parent e33f402046
commit 72b20b6f5a

View file

@ -50,13 +50,16 @@ ensure_conda_env_python310() {
conda create -n "${env_name}" python="${python_version}" -y conda create -n "${env_name}" python="${python_version}" -y
fi fi
eval "$(conda shell.bash hook)"
conda deactivate && conda activate "${env_name}"
# Re-installing llama-toolchain in the new conda environment # Re-installing llama-toolchain in the new conda environment
if git rev-parse --is-inside-work-tree &>/dev/null; then if git rev-parse --is-inside-work-tree &>/dev/null; then
repo_root=$(git rev-parse --show-toplevel) repo_root=$(git rev-parse --show-toplevel)
cd "$repo_root" cd "$repo_root"
conda run -n "${env_name}" pip install -e . pip install -e .
else else
conda run -n "${env_name}" pip install llama-toolchain pip install llama-toolchain
fi fi
if [ -n "$LLAMA_MODELS_DIR" ]; then if [ -n "$LLAMA_MODELS_DIR" ]; then
@ -66,14 +69,14 @@ ensure_conda_env_python310() {
fi fi
echo "Installing from LLAMA_MODELS_DIR: $LLAMA_MODELS_DIR" echo "Installing from LLAMA_MODELS_DIR: $LLAMA_MODELS_DIR"
conda run -n "${env_name}" pip uninstall -y llama-models pip uninstall -y llama-models
conda run -n "${env_name}" pip install -e "$LLAMA_MODELS_DIR" pip install -e "$LLAMA_MODELS_DIR"
fi fi
# Install pip dependencies # Install pip dependencies
if [ -n "$pip_dependencies" ]; then if [ -n "$pip_dependencies" ]; then
echo "Installing pip dependencies: $pip_dependencies" echo "Installing pip dependencies: $pip_dependencies"
conda run -n "${env_name}" pip install $pip_dependencies pip install $pip_dependencies
fi fi
} }
@ -91,9 +94,5 @@ ensure_conda_env_python310 "$env_name" "$pip_dependencies"
echo -e "${GREEN}Successfully setup distribution environment. Configuring...${NC}" echo -e "${GREEN}Successfully setup distribution environment. Configuring...${NC}"
eval "$(conda shell.bash hook)"
conda deactivate && conda activate "$env_name"
python_interp=$(conda run -n "$env_name" which python) python_interp=$(conda run -n "$env_name" which python)
$python_interp -m llama_toolchain.cli.llama distribution configure --name "$distribution_name" $python_interp -m llama_toolchain.cli.llama distribution configure --name "$distribution_name"