Add Mxbai(mixbread-ai) Embedding Model to Hub#2850
Open
laxmareddyp wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a checkpoint conversion script for HuggingFace mixedbread-ai mxbai-embed checkpoints to KerasHub format, supporting both BERT and XLM-RoBERTa architectures, and updates the BERT config converter to map the maximum sequence length. The review feedback recommends enhancing the conversion script's robustness by raising errors if numerical verification or semantic search ranking fails, rather than just printing diagnostics, to prevent saving corrupted presets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change
Add 4 mixedbread-ai (mxbai) embedding model presets to KerasHub.
License: Apache-2.0
Presets
mxbai_embed_large_v1_enmxbai_embed_2d_large_v1_enmxbai_embed_xsmall_v1_endeepset_mxbai_embed_de_large_v1Changes
tools/checkpoint_conversion/convert_mxbai_embed_checkpoints.py: Added conversion script for all 4 presets to usefrom_preset("hf://...")to leverage existing BERT/XLM-RoBERTa converters.keras_hub/src/utils/transformers/convert_bert.py: Bug fix — addedmax_sequence_lengthtoconvert_backbone_config(). Without this, BERT models with non-512max_position_embeddings(e.g., xsmall-v1 with 4096) fail during weight conversion due to position embedding shape mismatch.Checklist