File size: 1,060 Bytes
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
# 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 \
	cmake \
	&& rm -rf /var/lib/apt/lists/*

# 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 \
        torch \
        numpy \
        transformers

# 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"]