Skip to content

Commit aeba9c2

Browse files
dongfengtzolov
authored andcommitted
docs(onnx): Add a note when the onnxruntime_gpu dependency is missing.
1 parent 66e4b88 commit aeba9c2

File tree

1 file changed

+14
-1
lines changed
  • spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings

1 file changed

+14
-1
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/onnx.adoc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ The complete list of supported properties are:
7777
| spring.ai.embedding.transformer.cache.directory | Directory path to cache remote resources, such as the ONNX models | ${java.io.tmpdir}/spring-ai-onnx-model
7878
| spring.ai.embedding.transformer.onnx.modelUri | Existing, pre-trained ONNX model. | onnx/all-MiniLM-L6-v2/model.onnx
7979
| spring.ai.embedding.transformer.onnx.modelOutputName | The ONNX model's output node name, which we'll use for embedding calculation. | last_hidden_state
80-
| spring.ai.embedding.transformer.onnx.gpuDeviceId | The GPU device ID to execute on. Only applicable if >= 0. Ignored otherwise. | -1
80+
| spring.ai.embedding.transformer.onnx.gpuDeviceId | The GPU device ID to execute on. Only applicable if >= 0. Ignored otherwise.(Requires additional onnxruntime_gpu dependency) | -1
8181
| spring.ai.embedding.transformer.metadataMode | Specifies what parts of the Documents content and metadata will be used for computing the embeddings. | NONE
8282
|===
8383

@@ -114,6 +114,19 @@ The `model.onnx_data` is called link:https://onnx.ai/onnx/repo-docs/ExternalData
114114
Currently the only workaround is to copy the large `model.onnx_data` in the folder you run your Boot applicaiton.
115115
====
116116

117+
[NOTE]
118+
====
119+
If you get an error like `ai.onnxruntime.OrtException: Error code - ORT_EP_FAIL - message: Failed to find CUDA shared provider`,
120+
that means that you are using the GPU parameters `spring.ai.embedding.transformer.onnx.gpuDeviceId` , but the onnxruntime_gpu dependency are missing.
121+
----
122+
<dependency>
123+
<groupId>com.microsoft.onnxruntime</groupId>
124+
<artifactId>onnxruntime_gpu</artifactId>
125+
</dependency>
126+
----
127+
Please select the appropriate onnxruntime_gpu version based on the CUDA version(link:https://onnxruntime.ai/docs/get-started/with-java.html[ONNX Java Runtime]).
128+
====
129+
117130
== Manual Configuration
118131

119132
If you are not using Spring Boot, you can manually configure the Onnx Transformers Embedding Model.

0 commit comments

Comments
 (0)