This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from casperdcl/docker-cache
docker build speedups & memory reduction
- Loading branch information
Showing
50 changed files
with
202 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,17 @@ | ||
FROM python:3.10-slim-bullseye | ||
|
||
ARG MODEL_ID | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
git \ | ||
wget \ | ||
libatlas-base-dev \ | ||
ffmpeg | ||
|
||
COPY requirements.txt /usr/src/app/ | ||
|
||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
RUN apt update -qq && apt install -yqq --no-install-recommends \ | ||
build-essential git wget libatlas-base-dev ffmpeg \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
ARG MODEL_ID | ||
COPY download.py . | ||
|
||
RUN python3 download.py --model $MODEL_ID | ||
RUN python download.py --model $MODEL_ID | ||
|
||
COPY . . | ||
|
||
ENV MODEL_ID=$MODEL_ID | ||
ENV DEVICE=cpu | ||
|
||
CMD python3 main.py | ||
CMD python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
FROM huggingface/transformers-pytorch-gpu:latest | ||
|
||
ARG MODEL_ID | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
COPY requirements.txt /usr/src/app/ | ||
|
||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
RUN cd $(dirname $(which python3)) && ln -s python3 python | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
ARG MODEL_ID | ||
COPY download.py . | ||
|
||
RUN python3 download.py --model $MODEL_ID | ||
RUN python download.py --model $MODEL_ID | ||
|
||
COPY . . | ||
|
||
ENV MODEL_ID=$MODEL_ID | ||
ENV DEVICE=cuda | ||
|
||
CMD python3 main.py | ||
CMD python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.0 | ||
export VERSION=1.0.1 | ||
source "$(dirname "${BASH_SOURCE[0]}")/../utils.sh" | ||
|
||
build_gpu ghcr.io/premai-io/coder-replit-code-v1-3b-gpu replit/replit-code-v1-3b ${@:1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
FROM huggingface/transformers-pytorch-gpu:4.28.1 | ||
|
||
ARG MODEL_ID | ||
|
||
RUN pip install "accelerate>=0.16.0,<1" | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN pip install --no-cache-dir -r ./requirements.txt --upgrade pip | ||
RUN cd $(dirname $(which python3)) && ln -s python3 python | ||
COPY requirements.txt . | ||
RUN pip install "accelerate>=0.16.0,<1" | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
ARG MODEL_ID | ||
COPY download.py . | ||
|
||
RUN python3 download.py --model $MODEL_ID | ||
RUN python download.py --model $MODEL_ID | ||
|
||
COPY . . | ||
|
||
ENV MODEL_ID=$MODEL_ID | ||
|
||
CMD python3 main.py | ||
CMD python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.0 | ||
export VERSION=1.0.1 | ||
source "$(dirname "${BASH_SOURCE[0]}")/../utils.sh" | ||
|
||
build_cpu ghcr.io/premai-io/coder-codet5p-220m-py-cpu Salesforce/codet5p-220m-py ${@:1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
FROM python:3.10-slim-bullseye | ||
|
||
ARG MODEL_ID | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN pip install --no-cache-dir -r ./requirements.txt --upgrade pip | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
ARG MODEL_ID | ||
COPY download.py . | ||
|
||
RUN python3 download.py --model $MODEL_ID | ||
RUN python download.py --model $MODEL_ID | ||
|
||
COPY . . | ||
|
||
ENV MODEL_ID=$MODEL_ID | ||
ENV DEVICE=cpu | ||
|
||
CMD python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.3 | ||
export VERSION=1.0.4 | ||
source "$(dirname "${BASH_SOURCE[0]}")/../utils.sh" | ||
|
||
build_gpu ghcr.io/premai-io/chat-dolly-v2-12b-gpu databricks/dolly-v2-12b ${@:1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
FROM huggingface/transformers-pytorch-gpu:4.28.1 | ||
|
||
ARG MODEL_ID | ||
|
||
RUN pip install "accelerate>=0.16.0,<1" | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN pip install --no-cache-dir -r ./requirements.txt --upgrade pip | ||
RUN cd $(dirname $(which python3)) && ln -s python3 python | ||
COPY requirements.txt . | ||
RUN pip install "accelerate>=0.16.0,<1" | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
ARG MODEL_ID | ||
COPY download.py . | ||
|
||
RUN python3 download.py --model $MODEL_ID | ||
RUN python download.py --model $MODEL_ID | ||
|
||
COPY . . | ||
|
||
ENV MODEL_ID=$MODEL_ID | ||
ENV DEVICE=auto | ||
|
||
CMD python3 main.py | ||
#ENV DEVICE=auto | ||
CMD python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.0 | ||
export VERSION=1.0.1 | ||
source "$(dirname "${BASH_SOURCE[0]}")/../utils.sh" | ||
|
||
build_gpu ghcr.io/premai-io/chat-falcon-7b-instruct-gpu tiiuae/falcon-7b-instruct ${@:1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
FROM huggingface/transformers-pytorch-gpu:4.28.1 | ||
|
||
ARG MODEL_ID | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN pip install --no-cache-dir -r ./requirements.txt --upgrade pip | ||
RUN cd $(dirname $(which python3)) && ln -s python3 python | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
ARG MODEL_ID | ||
COPY download.py . | ||
|
||
RUN python3 download.py --model $MODEL_ID | ||
RUN python download.py --model $MODEL_ID | ||
|
||
COPY . . | ||
|
||
ENV MODEL_ID=$MODEL_ID | ||
|
||
CMD python3 main.py | ||
CMD python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
FROM huggingface/transformers-pytorch-gpu:4.28.1 | ||
|
||
ARG MODEL_ID | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN pip install --no-cache-dir -r ./requirements.txt --upgrade pip | ||
RUN cd $(dirname $(which python3)) && ln -s python3 python | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
ARG MODEL_ID | ||
COPY download.py . | ||
|
||
RUN python3 download.py --model $MODEL_ID | ||
RUN python download.py --model $MODEL_ID | ||
|
||
COPY . . | ||
|
||
ENV MODEL_ID=$MODEL_ID | ||
|
||
CMD python3 main.py | ||
CMD python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
FROM python:3.10-slim-bullseye | ||
|
||
ARG MODEL_ID | ||
|
||
RUN apt update && apt install -y libopenblas-dev ninja-build build-essential wget | ||
RUN python -m pip install --upgrade pip pytest cmake scikit-build setuptools | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
RUN wget https://prem-models.s3.eu-central-1.amazonaws.com/${MODEL_ID}.bin | ||
RUN mkdir -p ./ml/models/ | ||
RUN mv ${MODEL_ID}.bin ./ml/models/ | ||
|
||
COPY requirements.txt ./ | ||
RUN apt update -qq && apt install -yqq --no-install-recommends \ | ||
libopenblas-dev ninja-build build-essential wget \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY requirements.txt . | ||
#RUN pip install pytest cmake scikit-build setuptools | ||
RUN pip install --no-cache-dir -r ./requirements.txt | ||
|
||
RUN pip install --no-cache-dir -r ./requirements.txt --upgrade pip | ||
ARG MODEL_ID | ||
RUN mkdir -p ./ml/models/ | ||
RUN wget -O ./ml/models/${MODEL_ID}.bin https://prem-models.s3.eu-central-1.amazonaws.com/${MODEL_ID}.bin | ||
|
||
COPY . . | ||
|
||
ENV MODEL_ID=$MODEL_ID | ||
|
||
CMD python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.