Documentation ¶
Index ¶
- func GetSafeTensors(dirpath string, params *Params) ([]llm.Tensor, error)
- func GetTensorName(n string) (string, error)
- func ReadSafeTensors(fn string, offset uint64, params *Params) ([]llm.Tensor, uint64, error)
- type ByteOrder
- type GemmaModel
- type MetaData
- type MistralModel
- type ModelArch
- type ModelData
- type Params
- type Vocab
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTensorName ¶
Types ¶
type ByteOrder ¶ added in v0.1.32
type ByteOrder interface { binary.ByteOrder binary.AppendByteOrder }
type GemmaModel ¶ added in v0.1.32
type GemmaModel struct {
ModelData
}
func (*GemmaModel) GetTensors ¶ added in v0.1.32
func (m *GemmaModel) GetTensors() error
func (*GemmaModel) LoadVocab ¶ added in v0.1.32
func (m *GemmaModel) LoadVocab() error
func (*GemmaModel) WriteGGUF ¶ added in v0.1.32
func (m *GemmaModel) WriteGGUF() (string, error)
type MistralModel ¶ added in v0.1.32
type MistralModel struct {
ModelData
}
func (*MistralModel) GetTensors ¶ added in v0.1.32
func (m *MistralModel) GetTensors() error
func (*MistralModel) LoadVocab ¶ added in v0.1.32
func (m *MistralModel) LoadVocab() error
func (*MistralModel) WriteGGUF ¶ added in v0.1.32
func (m *MistralModel) WriteGGUF() (string, error)
type Params ¶
type Params struct { Architectures []string `json:"architectures"` VocabSize int `json:"vocab_size"` HiddenSize int `json:"hidden_size"` // n_embd HiddenLayers int `json:"num_hidden_layers"` // n_layer ContextSize int `json:"max_position_embeddings"` IntermediateSize int `json:"intermediate_size"` AttentionHeads int `json:"num_attention_heads"` // n_head KeyValHeads int `json:"num_key_value_heads"` NormEPS float64 `json:"rms_norm_eps"` BoSTokenID int `json:"bos_token_id"` EoSTokenID int `json:"eos_token_id"` HeadDimension int `json:"head_dim"` PaddingTokenID int `json:"pad_token_id"` ByteOrder }
type Vocab ¶
Details on gguf's tokenizer can be found at: https://github.com/ggerganov/ggml/blob/master/docs/gguf.md#tokenizer
Click to show internal directories.
Click to hide internal directories.