Transformers
xlm-roberta
🇪🇺 Region: EU

Run this model with HF Jobs

Run jinaai/xlm-roberta-flash-implementation on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/jinaai/xlm-roberta-flash-implementation. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/jinaai/xlm-roberta-flash-implementation on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Call post_init() in XLMRobertaLoRA for transformers v5

#64

Fixes #62. Heads up: I prepared this with AI assistance (Claude Code) and reviewed and tested it myself.

XLMRobertaLoRA.__init__ doesn't call self.post_init(), which transformers v5 requires (#60 added it to the classes in modeling_xlm_roberta.py, but not here). So loading jinaai/jina-embeddings-v3 on transformers>=5 fails with:

AttributeError: 'XLMRobertaLoRA' object has no attribute 'all_tied_weights_keys'

This adds self.post_init() at the end of XLMRobertaLoRA.__init__.

Testing (RTX PRO 6000; SentenceTransformer("jinaai/jina-embeddings-v3", trust_remote_code=True).encode(..., task="text-matching") on 4 sentences)

transformers current code this PR
4.57.6 works embeddings bit-identical to current code
5.17.0 AttributeError above embeddings bit-identical to 4.57.6
  • The load_trained_adapters=False path (fresh adapters on a pretrained XLMRobertaModel) gives a bit-identical state dict to the current code on 4.57.6 (seeded, 492/492 tensors equal), so post_init() doesn't re-initialize anything there.
  • vLLM's test_matryoshka HF-vs-vLLM comparison for jina-embeddings-v3 passes with this change on transformers 5.17.0 (it's currently skipped in vLLM because of this error).
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment