Skip to content

Commit

Permalink
trying to decrease layer size...
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkosm committed Dec 26, 2024
1 parent cbc44a4 commit 137c9ba
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 11 deletions.
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,19 @@ WORKDIR $APP_HOME
COPY pyproject.toml poetry.lock ./

ENV PATH="/root/.local/bin:$PATH"
# Install core dependencies first
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-root
poetry install --no-interaction --no-root \
--only main && \
rm -rf /root/.cache/pypoetry

# Install ML and other dependencies
RUN poetry install --no-interaction --no-root --with ml && \
rm -rf /root/.cache/pypoetry
RUN poetry install --no-interaction --no-root --with vision && \
rm -rf /root/.cache/pypoetry
RUN poetry install --no-interaction --no-root --with docs && \
rm -rf /root/.cache/pypoetry

COPY . ./
COPY magic-pdf.gpu.json /root/magic-pdf.json
Expand Down
52 changes: 50 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 18 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,34 @@ authors = ["neka-nat <nekanat.stock@gmail.com>"]
license = "AGPL-3.0"
readme = "README.md"

# Core dependencies
[tool.poetry.dependencies]
python = ">=3.10,<3.11"
magic-pdf = {extras = ["full"], version = ">=0.9.2"}
hydra-core = "^1.3.2"
fastapi = "^0.111.1"
uvicorn = {extras = ["standard"], version = "^0.30.3"}
hydra-core = "^1.3.2"
numpy = "1.26.4"

# ML/DL framework dependencies
[tool.poetry.group.ml.dependencies]
torch = "2.3.0"
torchtext = "0.18.0"
timm = ">=0.9.16,<0.10.0"
albumentations = "^1.4.12"
gotenberg-client = "^0.6.0"
fastapi = "^0.111.1"
transformers = "4.42.4"
fairscale = "^0.4.13"
ftfy = "^6.2.0"

# Vision and data processing
[tool.poetry.group.vision.dependencies]
albumentations = "^1.4.12"
decord = "^0.6.0"
webdataset = "^0.2.86"
torch = "2.3.0"
numpy = "1.26.4"
iopath = ">=0.1.7,<0.1.10"

# Document processing
[tool.poetry.group.docs.dependencies]
magic-pdf = {extras = ["full"], version = ">=0.9.2"}
gotenberg-client = "^0.6.0"
ftfy = "^6.2.0"
modelscope = "^1.20.1"

[[tool.poetry.source]]
Expand Down

0 comments on commit 137c9ba

Please sign in to comment.