diff --git a/jupyter-llm-notebook/Dockerfile b/jupyter-llm-notebook/Dockerfile index 7aaae53..632b102 100644 --- a/jupyter-llm-notebook/Dockerfile +++ b/jupyter-llm-notebook/Dockerfile @@ -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} \ No newline at end of file diff --git a/jupyter-llm-notebook/install-dependencies.sh b/jupyter-llm-notebook/install-dependencies.sh deleted file mode 100644 index e69de29..0000000 diff --git a/jupyter-llm-notebook/install-sciml-deps.sh b/jupyter-llm-notebook/install-sciml-deps.sh new file mode 100644 index 0000000..7060270 --- /dev/null +++ b/jupyter-llm-notebook/install-sciml-deps.sh @@ -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" \ No newline at end of file