Skip to content

Commit

Permalink
Modernbert install from git (#508)
Browse files Browse the repository at this point in the history
* add modernbert?

* update : docker

* update docker image
  • Loading branch information
michaelfeil authored Jan 3, 2025
1 parent 2ed3884 commit c69f927
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/assets/openapi.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libs/client_infinity/infinity_client/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "infinity_client"
version = "0.0.73"
version = "0.0.74"
description = "A client library for accessing ♾️ Infinity - Embedding Inference Server"
authors = []
readme = "README.md"
Expand Down
7 changes: 4 additions & 3 deletions libs/infinity_emb/Dockerfile.amd_auto
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ENV INFINITY_BETTERTRANSFORMER="0"

WORKDIR /app

FROM base as builder
FROM base AS builder
# Set the working directory for the app
# Define the version of Poetry to install (default is 1.8.4)
# Define the directory to install Poetry to (default is /opt/poetry)
Expand Down Expand Up @@ -86,9 +86,10 @@ else \
echo "NO GPU_ARCH, skip optium: ${GPU_ARCH}"; \
fi

# TODO: remove this line
RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@42865860ec6dc135972d9555753cb7ee17f51fb4 && rm -rf ~/.cache/ /tmp/*


FROM builder as testing
FROM builder AS testing
# install lint and test dependencies
# "RUN poetry install --no-interaction --no-ansi --extras \"${EXTRAS}\" --with lint,test && poetry cache clear pypi --all"
COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh
Expand Down
7 changes: 4 additions & 3 deletions libs/infinity_emb/Dockerfile.cpu_auto
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ENV INFINITY_ENGINE="optimum"

WORKDIR /app

FROM base as builder
FROM base AS builder
# Set the working directory for the app
# Define the version of Poetry to install (default is 1.8.4)
# Define the directory to install Poetry to (default is /opt/poetry)
Expand Down Expand Up @@ -53,9 +53,10 @@ RUN ./requirements_install_from_poetry.sh --without lint,test "https://download
RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino

#
# TODO: remove this line
RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@42865860ec6dc135972d9555753cb7ee17f51fb4 && rm -rf ~/.cache/ /tmp/*


FROM builder as testing
FROM builder AS testing
# install lint and test dependencies
# "RUN poetry install --no-interaction --no-ansi --extras \"${EXTRAS}\" --with lint,test && poetry cache clear pypi --all"
COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh
Expand Down
7 changes: 4 additions & 3 deletions libs/infinity_emb/Dockerfile.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y build-essential
{{extra_env_variables | default('')}}
WORKDIR /app

FROM base as builder
FROM base AS builder
# Set the working directory for the app
# Define the version of Poetry to install (default is 1.8.4)
# Define the directory to install Poetry to (default is /opt/poetry)
Expand All @@ -43,9 +43,10 @@ COPY infinity_emb infinity_emb
# Install dependency with infinity_emb package
{{main_install|replace("--no-root","")}}
{{extra_installs_main | default('#')}}
# TODO: remove this line
RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@42865860ec6dc135972d9555753cb7ee17f51fb4 && rm -rf ~/.cache/ /tmp/*


FROM builder as testing
FROM builder AS testing
# install lint and test dependencies
{{main_install|replace("--without", "--with")|replace("--no-root","")}}
# lint
Expand Down
7 changes: 4 additions & 3 deletions libs/infinity_emb/Dockerfile.nvidia_auto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y build-essential

WORKDIR /app

FROM base as builder
FROM base AS builder
# Set the working directory for the app
# Define the version of Poetry to install (default is 1.8.4)
# Define the directory to install Poetry to (default is /opt/poetry)
Expand All @@ -43,9 +43,10 @@ COPY infinity_emb infinity_emb
# Install dependency with infinity_emb package
RUN poetry install --no-interaction --no-ansi --extras "${EXTRAS}" --without lint,test && poetry cache clear pypi --all
#
# TODO: remove this line
RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@42865860ec6dc135972d9555753cb7ee17f51fb4 && rm -rf ~/.cache/ /tmp/*


FROM builder as testing
FROM builder AS testing
# install lint and test dependencies
RUN poetry install --no-interaction --no-ansi --extras "${EXTRAS}" --with lint,test && poetry cache clear pypi --all
# lint
Expand Down
7 changes: 4 additions & 3 deletions libs/infinity_emb/Dockerfile.trt_onnx_auto
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ENV PATH=/app/.venv/lib/${PYTHON}/site-packages/tensorrt/bin:${PATH}

WORKDIR /app

FROM base as builder
FROM base AS builder
# Set the working directory for the app
# Define the version of Poetry to install (default is 1.8.4)
# Define the directory to install Poetry to (default is /opt/poetry)
Expand All @@ -50,9 +50,10 @@ RUN apt-get install -y --no-install-recommends openmpi-bin libopenmpi-dev git gi
RUN poetry run $PYTHON -m pip install --no-cache-dir flash-attn --no-build-isolation
RUN poetry run $PYTHON -m pip install --no-cache-dir "tensorrt==10.3.0" "tensorrt_lean==10.3.0" "tensorrt_dispatch==10.3.0"

# TODO: remove this line
RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@42865860ec6dc135972d9555753cb7ee17f51fb4 && rm -rf ~/.cache/ /tmp/*


FROM builder as testing
FROM builder AS testing
# install lint and test dependencies
RUN poetry install --no-interaction --no-ansi --extras "${EXTRAS}" --with lint,test && poetry cache clear pypi --all
# lint
Expand Down
13 changes: 7 additions & 6 deletions libs/infinity_emb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ template_docker:

# Add new targets
build-amd:
docker buildx build -t michaelf34/infinity:$(VERSION)-amd -f Dockerfile.amd_auto --push .
docker buildx build --platform linux/amd64 -t michaelf34/infinity:$(VERSION)-amd -f Dockerfile.amd_auto --push .

build-trt:
docker buildx build -t michaelf34/infinity:$(VERSION)-trt-onnx -f Dockerfile.trt_onnx_auto --push .
docker buildx build --platform linux/amd64 -t michaelf34/infinity:$(VERSION)-trt-onnx -f Dockerfile.trt_onnx_auto --push .

build-cpu:
docker buildx build -t michaelf34/infinity:$(VERSION)-cpu -f Dockerfile.cpu_auto --push .
docker buildx build --platform linux/amd64 -t michaelf34/infinity:$(VERSION)-cpu -f Dockerfile.cpu_auto --push .

build-nvidia:
docker buildx build --platform linux/amd64 -t michaelf34/infinity:$(VERSION) -f Dockerfile.nvidia_auto --push .

# Combined target to build both
build-all-docker:
docker buildx build -t michaelf34/infinity:$(VERSION)-amd -f Dockerfile.amd_auto --push . & \
docker buildx build -t michaelf34/infinity:$(VERSION)-trt-onnx -f Dockerfile.trt_onnx_auto --push .
build-all-docker: build-nvidia build-cpu build-amd build-trt

poetry_check:
poetry check
Expand Down
16 changes: 8 additions & 8 deletions libs/infinity_emb/poetry.lock

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

2 changes: 1 addition & 1 deletion libs/infinity_emb/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[tool.poetry]
name = "infinity_emb"
version = "0.0.73"
version = "0.0.74"
description = "Infinity is a high-throughput, low-latency REST API for serving text-embeddings, reranking models and clip."
authors = ["michaelfeil <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit c69f927

Please sign in to comment.