-
Notifications
You must be signed in to change notification settings - Fork 177
Description
What happened?
Loading either intfloat/multilingual-e5-large or jinaai/jina-embeddings-v3 fails with onnxruntime==1.24.1.
To reproduce create an instance of the model, e.g. TextEmbedding(model_name="jinaai/jina-embeddings-v3"). The results in FAIL : External data path validation failed for initializer […] Error: tensorprotoutils.cc:346 ValidateExternalDataPath External data path: "model.onnx_data" escapes model directory.
This is most likely due to a new security check that was added in that release.
I suspect, any model that specifies additional_files in the BaseModelDescription is affected, but have only tested the two mentioned above. Manually setting the cache_dir does not change the behavior.
Environment
python 3.14.2
fastembed==0.7.4
onnxruntime==1.24.1
What is the expected behaviour?
The model should load and be ready for inference.
A minimal reproducible example
TextEmbedding(model_name="jinaai/jina-embeddings-v3")
What Python version are you on? e.g. python --version
Python 3.14.2
FastEmbed version
v0.7.4
What os are you seeing the problem on?
Linux
Relevant stack traces and/or logs
Traceback (most recent call last):
TextEmbedding(model_name="jinaai/jina-embeddings-v3")
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "../.venv/lib/python3.14/site-packages/fastembed/text/text_embedding.py", line 114, in __init__
self.model = EMBEDDING_MODEL_TYPE(
~~~~~~~~~~~~~~~~~~~~^
model_name=model_name,
^^^^^^^^^^^^^^^^^^^^^^
...<6 lines>...
**kwargs,
^^^^^^^^^
)
^
File "../.venv/lib/python3.14/site-packages/fastembed/text/multitask_embedding.py", line 49, in __init__
super().__init__(*args, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "../.venv/lib/python3.14/site-packages/fastembed/text/onnx_embedding.py", line 259, in __init__
self.load_onnx_model()
~~~~~~~~~~~~~~~~~~~~^^
File "../.venv/lib/python3.14/site-packages/fastembed/text/onnx_embedding.py", line 324, in load_onnx_model
self._load_onnx_model(
~~~~~~~~~~~~~~~~~~~~~^
model_dir=self._model_dir,
^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
extra_session_options=self._extra_session_options,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "../.venv/lib/python3.14/site-packages/fastembed/text/onnx_text_model.py", line 59, in _load_onnx_model
super()._load_onnx_model(
~~~~~~~~~~~~~~~~~~~~~~~~^
model_dir=model_dir,
^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
extra_session_options=extra_session_options,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "../.venv/lib/python3.14/site-packages/fastembed/common/onnx_model.py", line 108, in _load_onnx_model
self.model = ort.InferenceSession(
~~~~~~~~~~~~~~~~~~~~^
str(model_path), providers=onnx_providers, sess_options=so
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "../.venv/lib/python3.14/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 504, in __init__
self._create_inference_session(providers, provider_options, disabled_optimizers)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "../.venv/lib/python3.14/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 610, in _create_inference_session
sess.initialize_session(providers, provider_options, disabled_optimizers)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : External data path validation failed for initializer: roberta.embeddings.word_embeddings.parametrizations.weight.0.lora_B. Error: tensorprotoutils.cc:346 ValidateExternalDataPath External data path: "model.onnx_data" escapes model directory: "/tmp/fastembed_cache/models--jinaai--jina-embeddings-v3/snapshots/f1944de8402dcd5f2b03f822a4bc22a7f2de2eb9/onnx"