mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
Avoid using conda run
since it buffers everything
This commit is contained in:
parent
e33f402046
commit
72b20b6f5a
1 changed files with 8 additions and 9 deletions
|
@ -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"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue