public class OnnxEmbeddingModel extends AbstractInProcessEmbeddingModel
| Constructor and Description |
|---|
OnnxEmbeddingModel(Path pathToModel)
Deprecated.
|
OnnxEmbeddingModel(Path pathToModel,
Path pathToTokenizer,
PoolingMode poolingMode) |
OnnxEmbeddingModel(String pathToModel)
Deprecated.
|
OnnxEmbeddingModel(String pathToModel,
String pathToTokenizer,
PoolingMode poolingMode) |
| Modifier and Type | Method and Description |
|---|---|
protected OnnxBertBiEncoder |
model() |
embedAll, estimateTokenCount, loadFromJarpublic OnnxEmbeddingModel(Path pathToModel, Path pathToTokenizer, PoolingMode poolingMode)
pathToModel - The path to the modelPath file (e.g., "/path/to/model.onnx")pathToTokenizer - The path to the tokenizer file (e.g., "/path/to/tokenizer.json")poolingMode - The pooling model to use. Can be found in the ".../1_Pooling/config.json" file on HuggingFace.
Here is an example.
"pooling_mode_mean_tokens": true means that PoolingMode.MEAN should be used.public OnnxEmbeddingModel(String pathToModel, String pathToTokenizer, PoolingMode poolingMode)
pathToModel - The path to the model file (e.g., "/home/me/model.onnx")pathToTokenizer - The path to the tokenizer file (e.g., "/path/to/tokenizer.json")poolingMode - The pooling model to use. Can be found in the ".../1_Pooling/config.json" file on HuggingFace.
Here is an example.
"pooling_mode_mean_tokens": true means that PoolingMode.MEAN should be used.@Deprecated public OnnxEmbeddingModel(Path pathToModel)
OnnxEmbeddingModel(Path, Path, PoolingMode) or
OnnxEmbeddingModel(String, String, PoolingMode) instead.pathToModel - The path to the modelPath file (e.g., "/path/to/model.onnx")@Deprecated public OnnxEmbeddingModel(String pathToModel)
OnnxEmbeddingModel(Path, Path, PoolingMode) or
OnnxEmbeddingModel(String, String, PoolingMode) instead.pathToModel - The path to the modelPath file (e.g., "/path/to/model.onnx")protected OnnxBertBiEncoder model()
model in class AbstractInProcessEmbeddingModelCopyright © 2024. All rights reserved.