You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`combineChunksSimilarityThreshold`: Float (optional, default `0.5`) - Threshold for combining chunks based on similarity during the rebalance and combining phase.
78
78
-`onnxEmbeddingModel`: String (optional, default `Xenova/all-MiniLM-L6-v2`) - ONNX model used for creating embeddings.
79
79
-`dtype`: String (optional, default `fp32`) - Precision of the embedding model (options: `fp32`, `fp16`, `q8`, `q4`).
80
+
-`device`: String (optional, default `cpu`) - The execution provider to use for the model (options: `cpu`, `webgpu`).
80
81
-`localModelPath`: String (optional, default `null`) - Local path to save and load models (example: `./models`).
-`returnEmbedding`: Boolean (optional, default `false`) - If set to `true`, each chunk will include an embedding vector. This is useful for applications that require semantic understanding of the chunks. The embedding model will be the same as the one specified in `onnxEmbeddingModel`.
@@ -214,6 +215,12 @@ The behavior of the `chunkit` function can be finely tuned using several optiona
214
215
Link to a filtered list of embedding models converted to ONNX library format by Xenova.
215
216
Refer to the Model table below for a list of suggested models and their sizes (choose a multilingual model if you need to chunk text other than English).
216
217
218
+
### `device`
219
+
220
+
-**Type**: String
221
+
-**Default**: `cpu`
222
+
-**Description**: Specifies the execution provider for the model. Options are `cpu` and `webgpu`. Use `webgpu` to leverage GPU acceleration for faster processing. Note that WebGPU support may vary by environment.
223
+
217
224
#### `dtype`
218
225
219
226
-**Type**: String
@@ -280,6 +287,7 @@ There is an additional function you can import to just "cram" sentences together
280
287
-`maxTokenSize`: Integer (optional, default `500`) - Maximum token size for each chunk.
281
288
-`onnxEmbeddingModel`: String (optional, default `Xenova/all-MiniLM-L6-v2`) - ONNX model used for creating embeddings.
282
289
-`dtype`: String (optional, default `fp32`) - Precision of the embedding model (options: `fp32`, `fp16`, `q8`, `q4`).
290
+
-`device`: String (optional, default `cpu`) - The execution provider to use for the model (options: `cpu`, `webgpu`).
283
291
-`localModelPath`: String (optional, default `null`) - Local path to save and load models (example: `./models`).
-`returnEmbedding`: Boolean (optional, default `false`) - If set to `true`, each chunk will include an embedding vector. This is useful for applications that require semantic understanding of the chunks. The embedding model will be the same as the one specified in `onnxEmbeddingModel`.
@@ -337,6 +345,7 @@ There is an additional function you can import to just split sentences.
-`returnEmbedding`: Boolean (optional, default `false`) - If set to `true`, each chunk will include an embedding vector. This is useful for applications that require semantic understanding of the chunks. The embedding model will be the same as the one specified in `onnxEmbeddingModel`.
0 commit comments