-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (25 loc) · 1.26 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
FROM python:3.10
WORKDIR /app
# Install sentencepiece deps
RUN apt-get update && apt-get install -y \
pkg-config \
libsentencepiece-dev \
&& apt-get clean
# Download ACL Anthology deps and install
RUN curl -s https://raw.githubusercontent.com/acl-org/acl-anthology/master/bin/requirements.txt | \
grep -v '-e python/' > acl_requirements.txt && \
pip install --no-cache-dir -r acl_requirements.txt && \
pip cache purge
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt && pip cache purge
# Copy ColBERT files that aren't downloaded properly
COPY ./src/extras/segmented_maxsim.cpp /usr/local/lib/python3.10/site-packages/colbert/modeling/segmented_maxsim.cpp
COPY ./src/extras/decompress_residuals.cpp /usr/local/lib/python3.10/site-packages/colbert/search/decompress_residuals.cpp
COPY ./src/extras/filter_pids.cpp /usr/local/lib/python3.10/site-packages/colbert/search/filter_pids.cpp
COPY ./src/extras/segmented_lookup.cpp /usr/local/lib/python3.10/site-packages/colbert/search/segmented_lookup.cpp
COPY . .
# Test run the ColBERT model (and download the index from HF)
RUN python src/search.py
# CMD ["sh", "-c", "sleep infinity"]
CMD ["python", "src/server.py"]
# CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8080", "src/server:app"]