Table of Contents

Method GetEmbeddingsAsync

Namespace
LMKit.Abstractions
Assembly
LM-Kit.NET.dll

GetEmbeddingsAsync(IList<int>, CancellationToken)

Asynchronously generates the embedding vector for a pre-tokenized passage.

Task<float[]> GetEmbeddingsAsync(IList<int> tokens, CancellationToken cancellationToken = default)

Parameters

tokens IList<int>

The token list to embed. Cannot be null or empty.

cancellationToken CancellationToken

Optional token to cancel the operation.

Returns

Task<float[]>

A task whose result is the embedding vector for the tokens.

GetEmbeddingsAsync(IEnumerable<IList<int>>, CancellationToken)

Asynchronously generates embedding vectors for a batch of pre-tokenized passages.

Task<float[][]> GetEmbeddingsAsync(IEnumerable<IList<int>> tokens, CancellationToken cancellationToken = default)

Parameters

tokens IEnumerable<IList<int>>

The token lists to embed. Cannot be null or empty.

cancellationToken CancellationToken

Optional token to cancel the operation.

Returns

Task<float[][]>

A task whose result is an array of vectors, one per input token list and in the same order.

Share