-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move torch and transformers to local group (#1172)
- Loading branch information
Showing
5 changed files
with
566 additions
and
560 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM python:3.11.6-slim-bookworm as base | ||
|
||
# Install poetry | ||
RUN pip install pipx | ||
RUN python3 -m pipx ensurepath | ||
RUN pipx install poetry | ||
ENV PATH="/root/.local/bin:$PATH" | ||
|
||
# https://python-poetry.org/docs/configuration/#virtualenvsin-project | ||
ENV POETRY_VIRTUALENVS_IN_PROJECT=true | ||
|
||
FROM base as dependencies | ||
WORKDIR /home/worker/app | ||
COPY pyproject.toml poetry.lock ./ | ||
|
||
RUN poetry install --with ui | ||
|
||
FROM base as app | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
ENV PORT=8080 | ||
EXPOSE 8080 | ||
|
||
# Prepare a non-root user | ||
RUN adduser --system worker | ||
WORKDIR /home/worker/app | ||
|
||
RUN mkdir local_data; chown worker local_data | ||
RUN mkdir models; chown worker models | ||
COPY --chown=worker --from=dependencies /home/worker/app/.venv/ .venv | ||
COPY --chown=worker private_gpt/ private_gpt | ||
COPY --chown=worker docs/ docs | ||
COPY --chown=worker *.yaml *.md ./ | ||
|
||
USER worker | ||
ENTRYPOINT .venv/bin/python -m private_gpt |
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.