Availability of PyTorch / Onnx models

#19
by davidsitsky - opened

Hi intfloat - many thanks for publishing this model. Like all the other models in the multilingual-e5 family, can you please upload the PyTorch and Onnx model files? This would be really appreciated, and would add consistency as this one is missing them. Thank you.

@intfloat - any chance you can add in the pytorch_model.bin file please? Obviously I can generate this manually, but having it in the HF rep like the other E5 models would make workflows easier to manage.

Hi, I think huggingface/transformers has switched to safetensors by default, why would you need the pytorch_model.bin file?

Hi - I am using https://github.com/deepjavalibrary/djl and it has to ability to connect to HF and dynamically use models. It supports PyTorch or OnnxRuntime engines for this to work (from Java). I believe it does some auto-conversions into PyTorch typically behind the covers when opening a model.

When I tried to run one of its "model zoo importer" scripts explicitly on this model, it failed with this, but it works fine for all the other E5 models.

Unsupported model architecture: XLMRobertaModel for intfloat/multilingual-e5-large-instruct.

Is the model architecture for multilingual-e5-large-instruct different to the other E5 models? Or is this somehow related to a missing PyTorch model file (seems unlikely)?

Based on the error message, the reason is that XLMRobertaModel is not supported instead of missing Pytorch model file.

All English-only E5 models like intfloat/e5-small-v2 are based on BertModel, but multilingual ones like intfloat/multilingual-e5-small are based on XLMRobertaModel.

DJL works fine for intfloat/multilingual-e5-small and intfloat/multilingual-e5-large (I use them daily). So I wonder if the error message is misleading perhaps?

@intfloat - it turns out upgrading from DJL 0.28.0 to 0.30.0 fixes the issue for PyTorch as they are now able to use the safetensors file. So the error message was a red-herring.

However, if you can include the ONNX model files like you have with other multilingual-e5 models, that would be great for similar reasons I listed previously.

Thanks again for creating these!

Thanks for the feedback!

I have merged the pull request from https://huggingface.co/intfloat/multilingual-e5-large-instruct/discussions/17 that creates ONNX model files with https://huggingface.co/spaces/onnx/export .

Excellent - thank you!

davidsitsky changed discussion status to closed

Sign up or log in to comment