Class EmbeddingEngineSettings
- Namespace
- Uralstech.UAI.LiteRTLM
public sealed class EmbeddingEngineSettings : LiteRTLMNativeHandle
- Inheritance
-
objectEmbeddingEngineSettings
- Inherited Members
Constructors
EmbeddingEngineSettings(string, string, string?, string?)
Creates managed embedding engine settings from a model path. The caller is responsible for disposing the wrapper using Dispose().
public EmbeddingEngineSettings(string modelPath, string backend, string? visionBackend = null, string? audioBackend = null)
Parameters
modelPathstringThe path to the model file.
backendstringThe backend to use (e.g., "cpu", "gpu", "npu").
visionBackendstringThe vision backend to use, or null if not set.
audioBackendstringThe audio backend to use, or null if not set.
Exceptions
- InvalidOperationException
Thrown if the native object could not be created.
Methods
ReleaseUnmanagedResources()
protected override void ReleaseUnmanagedResources()
SetActivationDataType(ActivationDataType)
Sets the activation data type for the embedding engine settings.
public void SetActivationDataType(ActivationDataType activationDataType)
Parameters
activationDataTypeActivationDataTypeThe activation data type.
SetAudioLitertDispatchLibDir(string)
Sets the LiteRT dispatch library directory for the audio NPU backend.
public void SetAudioLitertDispatchLibDir(string libDir)
Parameters
libDirstringThe dispatch library directory.
SetAudioNumThreads(int)
Sets the number of threads for the audio CPU backend in Embedding Engine Settings.
public void SetAudioNumThreads(int numThreads)
Parameters
numThreadsintThe number of threads.
SetCacheDir(string)
Sets the cache directory for the Embedding Engine.
public void SetCacheDir(string cacheDir)
Parameters
cacheDirstringThe cache directory.
SetLitertDispatchLibDir(string)
Sets the LiteRT dispatch library directory for the main NPU backend.
public void SetLitertDispatchLibDir(string libDir)
Parameters
libDirstringThe dispatch library directory.
SetMaxInputLength(int)
Sets the maximum sequence length (in tokens) for text encoder signatures in Embedding Engine Settings.
public void SetMaxInputLength(int maxInputLength)
Parameters
maxInputLengthintThe maximum input length. Passing a non-positive value unsets the option.
SetMinInputLength(int)
Sets the minimum sequence length (in tokens) for text encoder signatures in Embedding Engine Settings.
public void SetMinInputLength(int minInputLength)
Parameters
minInputLengthintThe minimum input length. Passing a negative value unsets the option.
SetNumThreads(int)
Sets the number of threads for the CPU backend in Embedding Engine Settings.
public void SetNumThreads(int numThreads)
Parameters
numThreadsintThe number of threads.
SetVisionLitertDispatchLibDir(string)
Sets the LiteRT dispatch library directory for the vision NPU backend.
public void SetVisionLitertDispatchLibDir(string libDir)
Parameters
libDirstringThe dispatch library directory.
SetVisionTokensPerImage(int)
Sets the desired number of vision tokens generated per image in Embedding Engine Settings.
public void SetVisionTokensPerImage(int visionTokensPerImage)
Parameters
visionTokensPerImageintThe vision tokens per image. Passing a non-positive value unsets the option.