module

Llama

Constants

VERSION = "0.1.0"

Class methods

build_simple_generator(model_filename : String = "stories15M.bin", tokenizer_filename : String = "tokenizer.bin", models_dir : String = "models", temperature : Float32 = 1.0_f32, topp : Float32 = 0.9_f32, rng_seed : UInt64 = 0_u64)
Source
matmul(xout : Array(Float32), x : Array(Float32), w : ArrayView(Float32), n : Int32, d : Int32)
Source
matmul(xout : ArrayView(Float32), x : Array(Float32), w : ArrayView(Float32), n : Int32, d : Int32)
Source
matmul(xout : Array(Float32), x : Array(Float32), w : Array(Float32), n : Int32, d : Int32)
Source
random_f32(state : UInt64) : Float32
Source
random_u32(state : UInt64) : UInt32
Source
rmsnorm(xout : Array(Float32), x : Array(Float32), weight : Array(Float32), weight_offset : Int32, size : Int32)
Source
sample_argmax(probabilities : Array(Float32)) : Int32
Source
sample_mult(probabilities : Array(Float32), coin : Float32) : Int32
Source
sample_topp(probabilities : Array(Float32), topp : Float32, coin : Float32) : Int32
Source
softmax(x : Array(Float32), x_offset : Int32 = 0, x_slice_size : Int32 = x.size)
Source
str_lookup(str : String, sorted_vocab : Array(TokenIndex)) : Int32
Source

Nested types