new: BAAI/BGE-M3 support with testing script
All Submissions:
- [x] Have you followed the guidelines in our Contributing document?
- [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
New models submission:
- [x] Have you added an explanation of why it's important to include this model?
- [x] Have you added tests for the new model? Were canonical values for tests computed via the original model?
- [x] Have you added the code snippet for how canonical values were computed?
- [x] Have you successfully ran tests with your changes locally?
New Model: BAAI/bge-m3
MIT-Licensed:
| Model Name | Dimension | Sequence Length | Introduction |
|---|---|---|---|
| BAAI/bge-m3 | 1024 | 8192 | multilingual; unified fine-tuning (dense, sparse, and colbert) from bge-m3-unsupervised |
Code Snippet for Canonical Values:
docs = ["hello world", "flag embedding"]
embeddings = list(embedding_model.embed(docs))
embeddings = np.stack(embeddings, axis=0)
canonical = np.round(embeddings[0, :5], 4)
print(f"Canonical vector values: {canonical}")
Output:
Canonical vector values: [-0.0404 0.037 -0.029 0.0161 -0.0357]
Added these values in: tests/test_text_onnx_embeddings.py
This pull request adds support for the BAAI/bge-m3 multilingual text embedding model to the FastEmbed library. A new model entry is registered in the ๐ฏ 1 (Trivial) | โฑ๏ธ ~5 minutes โ๏ธ Tip: You can configure your own custom pre-merge checks in the settings.๐ Walkthrough
Walkthrough
supported_onnx_models list with metadata including embedding dimension (1024), model size (2.27 GB), license (MIT), and file paths for the ONNX model and associated resources. A corresponding canonical embedding vector is added to the test suite for verification purposes.Estimated code review effort
๐ฅ Pre-merge checks | โ
3
โ
Passed checks (3 passed)
Check name
Status
Explanation
Title check
โ
Passed
The title clearly and specifically describes the main change: adding support for the BAAI/BGE-M3 model with corresponding test coverage, which aligns perfectly with the changeset.
Description check
โ
Passed
The description is comprehensive and directly related to the changeset, providing model details, testing information, canonical values, and code snippets used to compute those values.
Docstring Coverage
โ
Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
โจ Finishing touches
๐งช Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
when will this merge?
I feel like the library is falling a bit behind in supporting models sadly
i agree
Any news?
Any update?
This seems like a really important model to support natively, given it encodes all 3 vector types in a single pass.