Skip to content

Support for loading jina-v5-nano retrieval adapter via eland#818

Open
gregoireco wants to merge 8 commits intomainfrom
feat/jina-v5-nano-support
Open

Support for loading jina-v5-nano retrieval adapter via eland#818
gregoireco wants to merge 8 commits intomainfrom
feat/jina-v5-nano-support

Conversation

@gregoireco
Copy link
Copy Markdown

No description provided.

@prodsecmachine
Copy link
Copy Markdown

prodsecmachine commented Mar 11, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

gregoireco and others added 5 commits March 11, 2026 18:45
…ntegration test

- Add _JinaEmbeddingsV5WrapperModule to _TransformerTraceableModel model
  union type to fix mypy [arg-type] error introduced by our wrapper
- Widen _SentenceTransformerWrapperModule.from_pretrained tokenizer param
  to accept PreTrainedTokenizerFast, fixing mypy [arg-type] at call site
- Gate test_jina_v5_import_pytest.py behind TEST_JINA_INTEGRATION=1 env var
  so the 424 MB HuggingFace model download is skipped in CI by default

Made-with: Cursor
These are optional pytorch-extras dependencies not installed in the lint
environment, so mypy was failing with import-not-found errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gregoireco gregoireco requested a review from davidkyle March 20, 2026 09:42
@gregoireco gregoireco removed the request for review from davidkyle March 27, 2026 10:56
edsavage added a commit to edsavage/ml-cpp that referenced this pull request Mar 29, 2026
Jina Embeddings v5 is based on EuroBERT, which uses a different
architecture from the BERT family:
- RoPE (rotary position embeddings) → aten::sin, aten::cos
- RMSNorm (instead of LayerNorm) → aten::rsqrt
- SiLU activation (instead of GELU) → aten::silu

Required for Eland PR elastic/eland#818 which adds support for
importing Jina v5 models into Elasticsearch.

Made-with: Cursor
Copy link
Copy Markdown
Contributor

@edsavage edsavage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of comments/questions from me.

It's also woth pointing out that, due to the recent pytorch_inference hardening work, these changes now have a dependency on the ml-cpp repo. I've created a draft PR - elastic/ml-cpp#3015 - that adds the new ops to the allowlist. It will need to be merged first.

if isinstance(result, (PreTrainedTokenizer, PreTrainedTokenizerFast)):
tokenizer = result
except Exception:
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're silently ignoring any exceptions here, should we at least log an error?

span: t.Optional[int] = None,
):
super().__init__(
configuration_type="byte_level_bpe",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does byte_level_bpe need ES Java support?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's already supported, byte level BPE corresponds to the roberta ES tokenizer config. But I didn't understand that prior to your comment :).

edsavage added a commit to edsavage/ml-cpp that referenced this pull request Apr 1, 2026
Jina Embeddings v5 is based on EuroBERT, which uses a different
architecture from the BERT family:
- RoPE (rotary position embeddings) → aten::sin, aten::cos
- RMSNorm (instead of LayerNorm) → aten::rsqrt
- SiLU activation (instead of GELU) → aten::silu

Required for Eland PR elastic/eland#818 which adds support for
importing Jina v5 models into Elasticsearch.

Made-with: Cursor
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.

4 participants