harpreetsahota commited on
Commit
cb446a2
1 Parent(s): e9741db

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +56 -0
Dockerfile ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
2
+ ENV DEBIAN_FRONTEND=noninteractive
3
+ RUN apt-get update && \
4
+ apt-get upgrade -y && \
5
+ apt-get install -y --no-install-recommends \
6
+ git \
7
+ git-lfs \
8
+ wget \
9
+ curl \
10
+ # python build dependencies \
11
+ build-essential \
12
+ libssl-dev \
13
+ zlib1g-dev \
14
+ libbz2-dev \
15
+ libreadline-dev \
16
+ libsqlite3-dev \
17
+ libncursesw5-dev \
18
+ xz-utils \
19
+ tk-dev \
20
+ libxml2-dev \
21
+ libxmlsec1-dev \
22
+ libffi-dev \
23
+ liblzma-dev \
24
+ # gradio dependencies \
25
+ ffmpeg \
26
+ && apt-get clean \
27
+ && rm -rf /var/lib/apt/lists/*
28
+
29
+ RUN useradd -m -u 1000 user
30
+ USER user
31
+ ENV HOME=/home/user \
32
+ PATH=/home/user/.local/bin:${PATH}
33
+ WORKDIR ${HOME}/app
34
+
35
+ RUN curl https://pyenv.run | bash
36
+ ENV PATH=${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:${PATH}
37
+ ARG PYTHON_VERSION=3.10.12
38
+ RUN pyenv install ${PYTHON_VERSION} && \
39
+ pyenv global ${PYTHON_VERSION} && \
40
+ pyenv rehash && \
41
+ pip install --no-cache-dir -U pip setuptools wheel && \
42
+ pip install torch transformers accelerate bitsandbytes gradio packaging ninja protobuf
43
+
44
+ COPY --chown=1000 ./requirements.txt /tmp/requirements.txt
45
+ RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt && \
46
+ pip install flash-attn --no-build-isolation
47
+
48
+ COPY --chown=1000 . ${HOME}/app
49
+ ENV PYTHONPATH=${HOME}/app \
50
+ PYTHONUNBUFFERED=1 \
51
+ GRADIO_ALLOW_FLAGGING=never \
52
+ GRADIO_NUM_PORTS=1 \
53
+ GRADIO_SERVER_NAME=0.0.0.0 \
54
+ GRADIO_THEME=huggingface \
55
+ SYSTEM=spaces
56
+ CMD ["python", "app.py"]