Skip to content

Commit

Permalink
Fix: openvino (#475)
Browse files Browse the repository at this point in the history
* undo openvino

* add poetry lock
  • Loading branch information
michaelfeil authored Nov 20, 2024
1 parent c2ccffe commit 28725ac
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 105 deletions.
3 changes: 2 additions & 1 deletion libs/infinity_emb/Docker.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ cpu:
# RUN sed -i 's|torch = "2.4.1"|torch = "2.5.0"|' pyproject.toml
# RUN sed -i 's|"pypi"|"pytorch_cpu"|' pyproject.toml
# RUN poetry lock --no-update
poetry_extras: "all openvino"
poetry_extras: "all"
main_install: |
# "RUN poetry install --no-interaction --no-ansi --no-root --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all"
COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh
RUN ./requirements_install_from_poetry.sh --no-root --without lint,test "https://download.pytorch.org/whl/cpu"
RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino
extra_env_variables: |
# Sets default to onnx
ENV INFINITY_ENGINE="optimum"
Expand Down
5 changes: 4 additions & 1 deletion libs/infinity_emb/Dockerfile.cpu_auto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ENV PYTHONUNBUFFERED=1 \
POETRY_VIRTUALENVS_IN_PROJECT="true" \
# do not ask any interactive question
POETRY_NO_INTERACTION=1 \
EXTRAS="all openvino" \
EXTRAS="all" \
PYTHON="python3.11"
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON curl
# Sets default to onnx
Expand All @@ -43,12 +43,14 @@ COPY poetry.lock poetry.toml pyproject.toml README.md /app/
# "RUN poetry install --no-interaction --no-ansi --no-root --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all"
COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh
RUN ./requirements_install_from_poetry.sh --no-root --without lint,test "https://download.pytorch.org/whl/cpu"
RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino

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"
COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh
RUN ./requirements_install_from_poetry.sh --without lint,test "https://download.pytorch.org/whl/cpu"
RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino

#

Expand All @@ -58,6 +60,7 @@ FROM builder as testing
# "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
RUN ./requirements_install_from_poetry.sh --with lint,test "https://download.pytorch.org/whl/cpu"
RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino

# lint
RUN poetry run ruff check .
Expand Down
3 changes: 3 additions & 0 deletions libs/infinity_emb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ build-amd:
build-trt:
docker buildx build -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 .

# Combined target to build both
build-all-docker:
docker buildx build -t michaelf34/infinity:$(VERSION)-amd -f Dockerfile.amd_auto --push . & \
Expand Down
105 changes: 6 additions & 99 deletions libs/infinity_emb/poetry.lock

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

8 changes: 4 additions & 4 deletions libs/infinity_emb/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ timm = {version = "*", optional=true}
colpali-engine = {version="^0.3.1", optional=true}
# openvino
# optimum-intel = {version=">=1.20.0", optional=true, extras=["openvino"]}
onnxruntime-openvino = {version=">=1.19.0", optional=true}
openvino = {version="2024.4.0", optional=true}
openvino-tokenizers = {version="2024.4.0.0", optional=true}
# onnxruntime-openvino = {version=">=1.19.0", optional=true}
# openvino = {version="2024.4.0", optional=true}
# openvino-tokenizers = {version="2024.4.0.0", optional=true}


# pin torchvision to a specific source, but default to pypi. use sed to overwrite.
Expand Down Expand Up @@ -106,7 +106,7 @@ einops=["einops"]
logging=["rich"]
cache=["diskcache"]
vision=["colpali-engine","pillow","timm","torchvision"]
openvino=["onnxruntime-openvino","openvino","openvino-tokenizers"]
# openvino=["onnxruntime-openvino","openvino","openvino-tokenizers"]
audio=["soundfile"]
server=[
"fastapi",
Expand Down

0 comments on commit 28725ac

Please sign in to comment.