Class to handle text embedding model on top of onnxruntime

Hierarchy (view full)

Constructors

Properties

eos: bigint = 2n
feed: Record<string, Tensor> = {}
sess?: InferenceSession

Methods

  • Generate embeddings from input tokens

    Parameters

    • tokens: bigint[]

      Input tokens to generate embeddings from

    Returns Promise<Float32Array<ArrayBufferLike>>

    Float32Array containing the embedding vector

  • Parameters

    • model: string
    • onnx_file: string = "onnx/model.onnx"
    • options: LoadOptions

    Returns Promise<void>