Skip to content

Conversation

@alvarobartt
Copy link
Member

What does this PR do?

This PR fixes how the config.json is read for e.g. nomic-ai/nomic-embed-text-v1 doesn't use the standard naming for the hidden_size, num_hidden_layers, and num_key_value_heads, but rather n_embd, n_layer, and n_head, respectively.

Note

Note that this is required given that the ONNX export for e.g. nomic-ai/nomic-embed-text-v1 is using optimized MHA/MQA nodes, hence the need for the reading the config.json to properly parse the past_key_values weights on the ONNX export.

Fixes #750

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline?
  • Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the documentation guidelines.
  • Did you write any new necessary tests? If applicable, did you include or update the insta snapshots?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

The `config.json` for e.g. `nomic-ai/nomic-embed-text-v1` doesn't use
the standard naming for the `hidden_size`, `num_hidden_layers`, and
`num_key_value_heads`, but rather `n_embd`, `n_layer`, and `n_head`,
respectively.

Note that this is required given that the ONNX export for e.g.
`nomic-ai/nomic-embed-text-v1` is using optimized MHA/MQA nodes, hence
the need for the reading the `config.json` to properly parse the
`past_key_values` weights on the ONNX export.
@alvarobartt alvarobartt changed the title Add serde renames for nomic-ai configuration Fix reading non-standard config for past_key_values in ONNX Nov 4, 2025
@alvarobartt alvarobartt merged commit 4e1df4a into main Nov 4, 2025
14 checks passed
@alvarobartt alvarobartt deleted the ort-renames-for-nomic-ai branch November 4, 2025 15:23
@alvarobartt alvarobartt added this to the v1.9.0 milestone Nov 5, 2025
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.

nomic-ai/nomic-embed-text-v1 - Failed to parse config.json: missing field hidden_size

2 participants