feat: add support for intfloat/multilingual-e5-small - #695
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughAdds Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR adds built-in support for a smaller multilingual embedding model and updates the related tests without changing existing interfaces or deployment behavior. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)
✨ 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 |
What
Adds built-in support for
intfloat/multilingual-e5-smallas a dense pooled text embedding model.Closes #123
Why
This model was explicitly requested in #123. It is a small (~118M params), fast,
multilingual E5-family model, complementing the already-supported
intfloat/multilingual-e5-large, for use cases needing lower latency/memory footprint.How I validated correctness
transformersimplementation of
intfloat/multilingual-e5-small(mean pooling over the last hiddenstate, matching
PooledEmbeddingpost-processing used for the whole E5 family),using the same input text (
"hello world") and comparison tolerance (atol=1e-3) asexisting tests in
tests/test_text_onnx_embeddings.py.dim=384andsize_in_GB=0.44verified against the actually downloaded ONNX artifact(
onnx/model.onnx= 470,268,510 bytes = 0.438 GiB).tests/test_custom_models.pypreviously usedintfloat/multilingual-e5-smallas theexample custom model; since the model is now built-in,
add_custom_modelcorrectlyrejects it. The example was switched to
Xenova/multilingual-e5-small(same weights,so the existing canonical values in that test remain valid and the test passes).
Note: a parallel PR adding this model (feat: add intfloat/multilingual-e5-small support #694) does not include this fix, and the
current
tests/test_custom_models.pyfails for any PR that registers this modelas built-in without it.
tests/test_text_onnx_embeddings.pyandtests/test_custom_models.pysuites locally — all passing.
ruff check/ruff format --check/ pre-commit hooks — all passing.Note on the parallel PR
While working on this, I noticed #694 addresses the same issue. This PR is submitted
independently; happy to consolidate with the author/maintainers on whichever version
is preferred.
Checklist
supported_pooled_modelsinfastembed/text/pooled_embedding.pytests/test_text_onnx_embeddings.pytests/test_custom_models.py(model is now built-in)