module Llama
Defined in:
llama.crllama/array_view.cr
llama/functions.cr
Constant Summary
-
VERSION =
"0.1.0"
Class Method Summary
- .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)
- .matmul(xout : Array(Float32), x : Array(Float32), w : ArrayView(Float32), n : Int32, d : Int32)
- .matmul(xout : ArrayView(Float32), x : Array(Float32), w : ArrayView(Float32), n : Int32, d : Int32)
- .matmul(xout : Array(Float32), x : Array(Float32), w : Array(Float32), n : Int32, d : Int32)
- .random_f32(state : UInt64) : Float32
- .random_u32(state : UInt64) : UInt32
- .rmsnorm(xout : Array(Float32), x : Array(Float32), weight : Array(Float32), weight_offset : Int32, size : Int32)
- .sample_argmax(probabilities : Array(Float32)) : Int32
- .sample_mult(probabilities : Array(Float32), coin : Float32) : Int32
- .sample_topp(probabilities : Array(Float32), topp : Float32, coin : Float32) : Int32
- .softmax(x : Array(Float32), x_offset : Int32 = 0, x_slice_size : Int32 = x.size)
- .str_lookup(str : String, sorted_vocab : Array(TokenIndex)) : Int32
Class Method Detail
def self.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)
#
def self.matmul(xout : Array(Float32), x : Array(Float32), w : ArrayView(Float32), n : Int32, d : Int32)
#
def self.matmul(xout : ArrayView(Float32), x : Array(Float32), w : ArrayView(Float32), n : Int32, d : Int32)
#
def self.matmul(xout : Array(Float32), x : Array(Float32), w : Array(Float32), n : Int32, d : Int32)
#
def self.rmsnorm(xout : Array(Float32), x : Array(Float32), weight : Array(Float32), weight_offset : Int32, size : Int32)
#
def self.sample_topp(probabilities : Array(Float32), topp : Float32, coin : Float32) : Int32
#
def self.softmax(x : Array(Float32), x_offset : Int32 = 0, x_slice_size : Int32 = x.size)
#