Skip to content

Commit e0a43b7

Browse files
authored
install jupyter-ai packages with onyxia init-script (#310)
1 parent f9f0bfe commit e0a43b7

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

base/scripts/onyxia-init.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ if [[ "$DARK_MODE" == "true" ]]; then
163163
fi
164164
fi
165165

166+
# install packages for jupyter-ai
167+
if [[ "$ENABLE_JUPYTER_AI_EXTENSION" == "true" ]]; then
168+
if command -v uv &>/dev/null; then
169+
uv pip install --system --no-cache jupyter-ai langchain-ollama langchain-openai
170+
else
171+
pip install --no-cache-dir jupyter-ai langchain-ollama langchain-openai
172+
fi
173+
fi
174+
166175
# inject proxy variables
167176
env_vars=("NO_PROXY" "no_proxy" "HTTP_PROXY" "http_proxy" "HTTPS_PROXY" "https_proxy")
168177

jupyter/scripts/install-jupyterlab.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@ function apt_install() {
1010
fi
1111
}
1212

13-
PACKAGES=("jupyterlab")
14-
15-
if [[ "$ENABLE_JUPYTER_AI_EXTENSION" == "true" ]]; then
16-
PACKAGES+=("jupyter-ai" "langchain-ollama" "langchain-openai")
17-
fi
18-
1913
if command -v uv &>/dev/null; then
20-
uv pip install --system --no-cache "${PACKAGES[@]}"
14+
uv pip install --system --no-cache jupyterlab
2115
else
22-
pip install --no-cache-dir "${PACKAGES[@]}"
16+
pip install --no-cache-dir jupyterlab
2317
fi

0 commit comments

Comments
 (0)