Skip to content

Add ONNX export support for D-FINE#2249

Merged
echarlaix merged 6 commits into
mainfrom
add-dfine
May 27, 2025
Merged

Add ONNX export support for D-FINE#2249
echarlaix merged 6 commits into
mainfrom
add-dfine

Conversation

@xenova

@xenova xenova commented Apr 30, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds ONNX export support for D-FINE models, added in huggingface/transformers#36261

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

@echarlaix @qubvel

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@echarlaix echarlaix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot @xenova

@xenova

xenova commented May 3, 2025

Copy link
Copy Markdown
Contributor Author

Should we wait for a new transformers release (which includes d-fine, as it's currently in main), or is merging now fine?

We currently get this error due to an out-of-date transformers version:

FAILED tests/exporters/onnx/test_export_cli.py::OnnxCLIExportTestCase::test_exporters_cli_pytorch_cpu_127_d_fine_no_task_ustc_community_dfine_n_coco - ValueError: The checkpoint you are trying to load has model type `d_fine` but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.

Merging is probably fine since it doesn't break anything for users, but it does make our CI red 😅

Comment thread tests/exporters/utils.py Outdated
Comment thread optimum/exporters/onnx/model_patcher.py Outdated
Comment thread optimum/exporters/onnx/model_configs.py Outdated
@echarlaix
echarlaix merged commit 93c284a into main May 27, 2025
@echarlaix
echarlaix deleted the add-dfine branch May 27, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants