private-model / install_packages.sh
ACCC1380's picture
Upload install_packages.sh with huggingface_hub
e8dd581 verified
#!/bin/bash
#install
ENABLE_MULTI_ENV=$1
BASE_PACKAGE=$2
chmod +x /opt/google/conda/install_to_env.sh
. "${DL_ANACONDA_HOME}/etc/profile.d/conda.sh"
# Installs Jupyterlab separate from" base packages if" ENABLE_MULTI_ENV,
# is defined when building container.
if [[ "${ENABLE_MULTI_ENV,,}" == 'true' ]]; then
if [[ "${BASE_PACKAGE}" == *"base"* ]]; then
BASE_PACKAGE="ml-framework"
fi
/opt/google/conda/install_to_env.sh jupyterlab dlenv-jupyterlab-meta
/opt/google/conda/install_to_env.sh base "dlenv-${BASE_PACKAGE}-meta"
conda activate jupyterlab
else
/opt/google/conda/install_to_env.sh base dlenv-${BASE_PACKAGE}-meta
conda activate ${BASE_PACKAGE}
fi
if [[ "${CONTAINER_NAME}" == *"beatrix"* ]]; then
BEATRIX_EXTENSION=$(gsutil ls "${CONTINUOUS_BUILD_PATH}" | tail -1) && \
gsutil cp "${BEATRIX_EXTENSION}" . && \
pip install "$(basename "${BEATRIX_EXTENSION}")"
jupyter labextension enable beatrix_jupyterlab
# Install Docker and dependencies
/opt/google/beatrix/setup_beatrix_container.sh
fi
jupyter lab build --debug && jupyter lab clean