class Llama::Embedder

Overview

Safe sentence embeddings over a dedicated embeddings-only context.

Included Modules

Defined in:

llama/embedder.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(model : Model, pooling : Pooling = Pooling::Mean, max_sequences : UInt32 = 8_u32, context_options : ContextOptions = ContextOptions.new) #

[View source]

Instance Method Detail

def close : Nil #

[View source]
def closed? : Bool #

[View source]
def dimension : Int32 #

[View source]
def embed(text : String, normalize : Bool = false) : Array(Float32) #

[View source]
def embed_all(texts : Enumerable(String), normalize : Bool = false) : Array(Array(Float32)) #

Embeds inputs in native multi-sequence batches while preserving input order.


[View source]
def finalize #

[View source]
def free : Nil #

[View source]
def to_unsafe #

[View source]