forked from h2oai/h2ogpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (51 loc) · 2.59 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# devel needed for bitsandbytes requirement of libcudart.so, otherwise runtime sufficient
FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu20.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
software-properties-common \
pandoc
ENV PATH="/h2ogpt_conda/bin:${PATH}"
ARG PATH="/h2ogpt_conda/bin:${PATH}"
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh && \
mkdir -p h2ogpt_conda && \
bash ./Miniconda3-py310_23.1.0-1-Linux-x86_64.sh -b -u -p /h2ogpt_conda && \
conda install python=3.10 -c conda-forge -y
WORKDIR /workspace
COPY requirements.txt requirements.txt
COPY reqs_optional reqs_optional
RUN python3.10 -m pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu117
RUN python3.10 -m pip install -r reqs_optional/requirements_optional_langchain.txt
RUN python3.10 -m pip install -r reqs_optional/requirements_optional_gpt4all.txt
RUN python3.10 -m pip install -r reqs_optional/requirements_optional_langchain.gpllike.txt
RUN python3.10 -m pip install -r reqs_optional/requirements_optional_langchain.urls.txt
RUN apt-get install -y libmagic-dev poppler-utils tesseract-ocr libtesseract-dev libreoffice
RUN python3.10 -m nltk.downloader all
ENV CUDA_HOME=/usr/local/cuda-11.7
# Install prebuilt dependencies
RUN python3.10 -m pip install https://s3.amazonaws.com/artifacts.h2o.ai/deps/h2ogpt/auto_gptq-0.3.0-cp310-cp310-linux_x86_64.whl --use-deprecated=legacy-resolver
RUN python3.10 -m pip install https://github.com/jllllll/llama-cpp-python-cuBLAS-wheels/releases/download/textgen-webui/llama_cpp_python_cuda-0.1.73+cu117-cp310-cp310-linux_x86_64.whl
RUN python3.10 -m pip install https://github.com/jllllll/exllama/releases/download/0.0.8/exllama-0.0.8+cu118-cp310-cp310-linux_x86_64.whl --no-cache-dir
COPY . .
RUN sp=`python3.10 -c 'import site; print(site.getsitepackages()[0])'` && sed -i 's/posthog\.capture/return\n posthog.capture/' $sp/chromadb/telemetry/posthog.py
EXPOSE 8888
EXPOSE 7860
ENV TRANSFORMERS_CACHE=/workspace/.cache/huggingface/hub/
ENV TIKTOKEN_CACHE_DIR=/workspace/.cache/
COPY build_info.txt* /build_info.txt
RUN touch /build_info.txt
ARG user=h2ogpt
ARG group=h2ogpt
ARG uid=1000
ARG gid=1000
RUN groupadd -g ${gid} ${group} && useradd -u ${uid} -g ${group} -s /bin/bash ${user}
RUN chmod -R a+rwx /workspace
RUN chmod -R a+rwx /h2ogpt_conda
ENV HOME=/workspace
USER h2ogpt
# preload encodings (add more as needed)
RUN python -c "import tiktoken; tiktoken.get_encoding('cl100k_base')"
RUN chmod -R a+rwx /workspace
ENTRYPOINT ["python3.10"]