class

ML::GGUF::NomicBertMoE(B)

Inherits Reference / Object

Constructors

new(gguf : GGUFFile, backend : B)
Source

Class methods

from_gguf(path : String, backend : B) : NomicBertMoE(B) forall B
Source
from_gguf(path : String) : NomicBertMoE(F32Backend)
Source

Instance methods

backend
Source
embed(text : String) : Array(Float32)

Embed a single text → Float32 array (dim=768)

Source
embed_batch(texts : Array(String)) : Array(Array(Float32))

Batch embed: pre-tokenize all texts, then sequential GPU forward passes (true parallel batching requires attention masking — future work)

Source
embed_debug(text : String, cpu_ref : Array(Array(Float32))) : Array(Float32)

Debug: embed with per-layer GPU vs CPU comparison

Source
embed_tokens(tokens : Array(Int32)) : Array(Float32)

Embed pre-tokenized input

Source
ffn_dim
Source
forward_hidden(text : String) : Array(Float32)

Run forward pass and return per-token hidden states (pre-pooling) For debugging/comparison with reference implementations.

Source
forward_hidden_per_layer(text : String) : Array(Array(Float32))

Return hidden states after each layer (for debugging precision)

Source
head_dim
Source
max_seq_len
Source
moe_every_n
Source
n_experts
Source
n_experts_used
Source
n_heads
Source
n_layers
Source
rope_theta
Source
tokenize(text : String) : Array(Int32)

Tokenize text → token IDs (delegates to SentencePiece unigram tokenizer)

Source
vocab_size
Source

Nested types