deepjavalibrary / djl

An Engine-Agnostic Deep Learning Framework in Java
https://djl.ai
Apache License 2.0
4.16k stars 661 forks source link

Add support for 'rotary' position embedding type for xml-roberta models #3536

Open Aelentel opened 5 days ago

Aelentel commented 5 days ago

Description

After converting the hugging face model "jinaai/jina-embeddings-v3" via djl-convert and patching the missing model type to "xml-roberta" it still barf on the unknown position embedding type.

version of djl-convert tested : 0.30.0 and 0.31.0

Will this change the current api? : absolutely no idea.

Who will benefit from this enhancement? any person using xml-roberta with "rotary" position embedding type

also this model is VERY efficient at embedding multilanguages and cross language semantic, i tested it on 20k docs on 13 different languages and the semantic matching was awesome, it'll be very good to support it.

References

model_name = "jinaai/jina-embeddings-v3" model_kwargs = {"device": "cuda","trust_remote_code":True}

hf = HuggingFaceEmbeddings(model_name=model_name, model_kwargs=model_kwargs)


- [blurb of the model](https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/)
- [hugging face model card](https://huggingface.co/jinaai/jina-embeddings-v3)

i'm pretty new on AI models so feel free to fix any of my mistakes :)