Table of Contents

Constructor Reranker

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

Reranker(LM)

Initializes a new instance of the Reranker class with the specified embedding-capable language model.

public Reranker(LM model)

Parameters

model LM

The LM instance to use for embedding computations. Must not be null and must support embeddings.

Examples

using LMKit.Model;
using LMKit.Embeddings;
using System;

// Load an embedding model
LM embeddingModel = LM.LoadFromModelID("embeddinggemma-300m");

// Create the reranker
Reranker reranker = new Reranker(embeddingModel);

Console.WriteLine($"Reranker initialized with model: {reranker.Model.Name}");

Exceptions

ArgumentNullException

Thrown when model is null.

InvalidModelException

Thrown when model does not support embeddings.