module Llama

Defined in:

llama.cr
llama/array_view.cr
llama/functions.cr

Constant Summary

VERSION = "0.1.0"

Class Method Summary

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) #

[View source]
def self.matmul(xout : Array(Float32), x : Array(Float32), w : ArrayView(Float32), n : Int32, d : Int32) #

[View source]
def self.matmul(xout : ArrayView(Float32), x : Array(Float32), w : ArrayView(Float32), n : Int32, d : Int32) #

[View source]
def self.matmul(xout : Array(Float32), x : Array(Float32), w : Array(Float32), n : Int32, d : Int32) #

[View source]
def self.random_f32(state : UInt64) : Float32 #

[View source]
def self.random_u32(state : UInt64) : UInt32 #

[View source]
def self.rmsnorm(xout : Array(Float32), x : Array(Float32), weight : Array(Float32), weight_offset : Int32, size : Int32) #

[View source]
def self.sample_argmax(probabilities : Array(Float32)) : Int32 #

[View source]
def self.sample_mult(probabilities : Array(Float32), coin : Float32) : Int32 #

[View source]
def self.sample_topp(probabilities : Array(Float32), topp : Float32, coin : Float32) : Int32 #

[View source]
def self.softmax(x : Array(Float32), x_offset : Int32 = 0, x_slice_size : Int32 = x.size) #

[View source]
def self.str_lookup(str : String, sorted_vocab : Array(TokenIndex)) : Int32 #

[View source]