fix(feature-extraction): support multilingual / XLM-R sentence embedders#33
Merged
Conversation
Two changes that unblock loading non-English sentence embedders such as paraphrase-multilingual-MiniLM-L12-v2: 1. PipelineConfig.tokenizerUrl — make the tokenizer URL overridable. The constructor previously hard-coded all-MiniLM-L6-v2's English-only tokenizer.json regardless of which model URL the user passed in. 2. Conditional token_type_ids — only emit this input when the loaded ONNX model declares it (looked up from session.inputNames via ModelMetadata). XLM-R, RoBERTa and multilingual MiniLM omit token_type_ids; unconditionally feeding it tripped onnxruntime-web with "invalid input" errors. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
s-zx
added a commit
that referenced
this pull request
May 12, 2026
Bumps to 0.2.0 (minor — new PipelineConfig.tokenizerUrl field shipped in #33 is additive backwards-compatible API surface). Also clears two pre-existing build/test failures that were blocking the release pipeline (unrelated to #33): - src/pipelines/question-answering.ts — remove dead private method tokenOffsetToCharOffset; TS6133 under noUnusedLocals. - tests/unit/runtime.test.ts — registerAllBackends() is sync void, so expect(...).resolves on its return value crashed vitest. Switch to expect(() => registerAllBackends()).not.toThrow(). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Two changes that unblock loading non-English sentence embedders such as paraphrase-multilingual-MiniLM-L12-v2:
PipelineConfig.tokenizerUrl — make the tokenizer URL overridable. The constructor previously hard-coded all-MiniLM-L6-v2's English-only tokenizer.json regardless of which model URL the user passed in.
Conditional token_type_ids — only emit this input when the loaded ONNX model declares it (looked up from session.inputNames via ModelMetadata). XLM-R, RoBERTa and multilingual MiniLM omit token_type_ids; unconditionally feeding it tripped onnxruntime-web with "invalid input" errors.
Summary
Brief description of the changes.
Motivation
Why is this change needed?
Changes
Testing
npm run test:unit)npx tsc --noEmit)npm run lint)Breaking Changes
List any breaking changes, or "None".