Fix model exports (#20540)

This commit is contained in:
Nicolas Mowen 2025-10-17 06:16:30 -06:00 committed by GitHub
parent a4764563a5
commit 0302db1c43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -988,7 +988,7 @@ COPY --from=ghcr.io/astral-sh/uv:0.8.0 /uv /bin/
WORKDIR /dfine WORKDIR /dfine
RUN git clone https://github.com/Peterande/D-FINE.git . RUN git clone https://github.com/Peterande/D-FINE.git .
RUN uv pip install --system -r requirements.txt RUN uv pip install --system -r requirements.txt
RUN uv pip install --system onnx onnxruntime onnxsim RUN uv pip install --system onnx onnxruntime onnxsim onnxscript
# Create output directory and download checkpoint # Create output directory and download checkpoint
RUN mkdir -p output RUN mkdir -p output
ARG MODEL_SIZE ARG MODEL_SIZE
@ -1012,7 +1012,7 @@ FROM python:3.11 AS build
RUN apt-get update && apt-get install --no-install-recommends -y libgl1 && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install --no-install-recommends -y libgl1 && rm -rf /var/lib/apt/lists/*
COPY --from=ghcr.io/astral-sh/uv:0.8.0 /uv /bin/ COPY --from=ghcr.io/astral-sh/uv:0.8.0 /uv /bin/
WORKDIR /rfdetr WORKDIR /rfdetr
RUN uv pip install --system rfdetr[onnxexport] RUN uv pip install --system rfdetr[onnxexport] torch==2.8.0 onnxscript
ARG MODEL_SIZE ARG MODEL_SIZE
RUN python3 -c "from rfdetr import RFDETR${MODEL_SIZE}; x = RFDETR${MODEL_SIZE}(resolution=320); x.export(simplify=True)" RUN python3 -c "from rfdetr import RFDETR${MODEL_SIZE}; x = RFDETR${MODEL_SIZE}(resolution=320); x.export(simplify=True)"
FROM scratch FROM scratch