Skip to content

Commit

Permalink
ENH: Update dockerfile and rename script
Browse files Browse the repository at this point in the history
Docerfile includes steps for copying and running the script.
Script renamed to make it clear what dependencies are being installed
  • Loading branch information
meoflynn committed Nov 20, 2024
1 parent 93f707e commit ab15e07
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
15 changes: 6 additions & 9 deletions jupyter-llm-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ RUN apt-get update && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

COPY install-sciml-deps.sh /home/${NB_USER}
RUN chown ${NB_UID} /home/${NB_USER}/install-sciml-deps.sh
RUN chmod +rx /home/${NB_USER}/install-sciml-deps.sh

USER $NB_UID
RUN set -ex \
&& buildDeps=' \
transformers \
accelerate \
bitsandbytes \
' \
&& pip install --no-cache-dir $buildDeps \
RUN /home/${NB_USER}/install-sciml-deps.sh \
&& fix-permissions "${CONDA_DIR}" \
&& fix-permissions "/home/${NB_USER}"

#switch back to jovyan to avoid accidental container runs as root
USER ${NB_UID}

USER ${NB_UID}
Empty file.
31 changes: 31 additions & 0 deletions jupyter-llm-notebook/install-sciml-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

echo -e "\nUninstalling conflicting libraries...\n"
pip uninstall -y tensorflow

echo -e "\nInstalling essential Python libraries...\n"
pip install --no-cache-dir --upgrade flask gdown jupyter matplotlib numpy pandas scipy spacy tqdm

echo -e "\nInstalling PyTorch...\n"
pip install --no-cache-dir --upgrade torch torchvision torchaudio

echo -e "\nInstalling HuggingFace libraries...\n"
pip install --no-cache-dir --upgrade huggingface_hub transformers accelerate

echo -e "\nInstalling bitsandbytes...\n"
pip install --no-cache-dir bitsandbytes -U

echo -e "\nInstalling LLM libraries...\n"
pip install --no-cache-dir --upgrade faiss-cpu networkx langchain langchain_community langgraph vllm

echo -e "\nDownloading spaCy language model...\n"
python -m spacy download en_core_web_sm

echo -e "\nInstalling Localtunnel...\n"
npm install -g localtunnel

echo -e "\nInstalling Ollama...\n"
OLLAMA_DIR="/home/${NB_USER}/ollama"
OLLAMA_RELEASE_URL="https://github.com/ollama/ollama/releases/download/v0.4.2/ollama-linux-amd64.tgz"
mkdir -p "$OLLAMA_DIR"
wget --quiet --show-progress -O- "$OLLAMA_RELEASE_URL" | tar -xz -C "$OLLAMA_DIR"

0 comments on commit ab15e07

Please sign in to comment.