File size: 1,131 Bytes
1fc2558
 
 
 
 
 
 
97781b0
1fc2558
97781b0
 
1fc2558
 
 
 
 
 
 
 
 
 
 
3ec9162
1fc2558
 
95c4e87
 
1fc2558
 
b911018
1fc2558
 
 
b911018
 
1fc2558
 
 
9c6997e
1fc2558
 
 
 
 
 
 
 
 
 
9c6997e
1fc2558
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
# See https://hub.docker.com/r/nikolaik/python-nodejs
#     https://github.com/nikolaik/docker-python-nodejs
# Default user is 'pn' with uid 1000, gid 1000
FROM python:3.10

RUN apt-get update && apt-get install -y \
	git \
	git-lfs \
	cmake \
	&& rm -rf /var/lib/apt/lists/* \
	&& git lfs install

# User
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH
WORKDIR /home/user/app

# Install Python deps
RUN pip install --no-cache-dir pip && \
    pip install --no-cache-dir \
        gradio \
        torch \
        numpy \
        transformers \
        accelerate

# Prepare bloomz.cpp
RUN git clone https://github.com/NouamaneTazi/bloomz.cpp

WORKDIR $HOME/app/bloomz.cpp

# just to ensure not being on main branch # TODO: might remove this in the future
RUN git checkout 4fc96cbf2e2c257eaca1cd7b7ed8e31741e672ee
RUN make

# Add files
COPY . $HOME/app

ENV PYTHONPATH=$HOME/app \
	PYTHONUNBUFFERED=1 \
	GRADIO_ALLOW_FLAGGING=never \
	GRADIO_NUM_PORTS=1 \
	GRADIO_SERVER_NAME=0.0.0.0 \
	GRADIO_THEME=huggingface \
	SYSTEM=spaces

# Run script
WORKDIR $HOME/app
CMD ["python", "app.py"]