Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions nlp-notebook/cuda12-pytorch-2.2.2-RAG/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG BASE_IMAGE=quay.io/a2s-institute/ml-notebook:cuda12-pytorch-2.2.2

FROM $BASE_IMAGE

LABEL maintainer="Mohammad Wasil <e2x@inf.h-brs.de>"

USER $NB_USER

COPY requirements.txt /tmp/requirements.txt
COPY chroma_fix.sh /tmp/chroma_fix.sh
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r /tmp/requirements.txt



USER root

RUN curl -fsSL https://ollama.com/install.sh | sh

RUN chmod +x /tmp/chroma_fix.sh && /tmp/chroma_fix.sh

# clean up
RUN rm /tmp/requirements.txt && \
/opt/conda/bin/conda clean -afy && \
find /opt/conda/ -follow -type f -name '*.a' -delete && \
find /opt/conda/ -follow -type f -name '*.pyc' -delete && \
find /opt/conda/ -follow -type f -name '*.js.map' -delete

USER $NB_USER

CMD ["ollama","serve"]
26 changes: 26 additions & 0 deletions nlp-notebook/cuda12-pytorch-2.2.2-RAG/chroma_fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# File you want to prepend lines to
TARGET_FILE="./opt/conda/lib/python3.11/site-packages/chromadb/__init__.py"

# Temporary file to store the existing content
TEMP_FILE=$(mktemp)

# Check if the file exists
if [ -f "$TARGET_FILE" ]; then
# Write the new lines to the temporary file
echo "__import__('pysqlite3')" > "$TEMP_FILE"
echo "import sys" >> "$TEMP_FILE"
echo "sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')" >> "$TEMP_FILE"

# Append the original content to the temporary file
cat "$TARGET_FILE" >> "$TEMP_FILE"

# Move the temporary file to the original file
mv "$TEMP_FILE" "$TARGET_FILE"

echo "Lines have been prepended to $TARGET_FILE"
else
echo "File not found!"
rm "$TEMP_FILE"
fi
13 changes: 13 additions & 0 deletions nlp-notebook/cuda12-pytorch-2.2.2-RAG/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
llama-index-core==0.10.63
llama-index-embeddings-huggingface==0.2.2
llama-index-llms-ollama==0.2.2
llama-index-readers-file==0.1.32
llama-index-vector-stores-chroma==0.1.10
chromadb==0.5.3
pysqlite3-binary==0.5.3
PyMuPDF==1.24.9
spacy
nltk
gensim
wikipedia-api
llama-cpp-python