Documentation ¶
Index ¶
- type ByteOrder
- type GemmaModel
- type LlamaModel
- type MistralModel
- type MixtralModel
- type ModelArch
- type ModelData
- type ModelFormat
- type Params
- type SafetensorFormat
- func (m *SafetensorFormat) GetLayerName(n string) (string, error)
- func (m *SafetensorFormat) GetModelArch(name, dirPath string, params *Params) (ModelArch, error)
- func (m *SafetensorFormat) GetParams(dirpath string) (*Params, error)
- func (m *SafetensorFormat) GetTensors(dirpath string, params *Params) ([]llm.Tensor, error)
- type TorchFormat
- func (m *TorchFormat) GetLayerName(n string) (string, error)
- func (m *TorchFormat) GetModelArch(name, dirPath string, params *Params) (ModelArch, error)
- func (m *TorchFormat) GetParams(dirpath string) (*Params, error)
- func (tf *TorchFormat) GetTensors(dirpath string, params *Params) ([]llm.Tensor, error)
- type Vocab
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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(ws io.WriteSeeker) error
type LlamaModel ¶ added in v0.1.33
type LlamaModel struct {
ModelData
}
func (*LlamaModel) GetTensors ¶ added in v0.1.33
func (m *LlamaModel) GetTensors() error
func (*LlamaModel) LoadVocab ¶ added in v0.1.33
func (m *LlamaModel) LoadVocab() error
func (*LlamaModel) WriteGGUF ¶ added in v0.1.33
func (m *LlamaModel) WriteGGUF(ws io.WriteSeeker) 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(ws io.WriteSeeker) error
type MixtralModel ¶ added in v0.1.33
type MixtralModel struct {
ModelData
}
func (*MixtralModel) GetTensors ¶ added in v0.1.33
func (m *MixtralModel) GetTensors() error
func (*MixtralModel) LoadVocab ¶ added in v0.1.33
func (m *MixtralModel) LoadVocab() error
func (*MixtralModel) WriteGGUF ¶ added in v0.1.33
func (m *MixtralModel) WriteGGUF(ws io.WriteSeeker) error
type ModelArch ¶ added in v0.1.32
type ModelArch interface { GetTensors() error LoadVocab() error WriteGGUF(io.WriteSeeker) error }
type ModelFormat ¶ added in v0.1.33
type ModelFormat interface { GetLayerName(string) (string, error) GetTensors(string, *Params) ([]llm.Tensor, error) GetParams(string) (*Params, error) GetModelArch(string, string, *Params) (ModelArch, error) }
func GetModelFormat ¶ added in v0.1.33
func GetModelFormat(dirname string) (ModelFormat, 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"` RopeFrequencyBase float64 `json:"rope_theta"` Experts int `json:"num_local_experts"` ExpertsUsed int `json:"num_experts_per_tok"` ByteOrder }
type SafetensorFormat ¶ added in v0.1.33
type SafetensorFormat struct{}
func (*SafetensorFormat) GetLayerName ¶ added in v0.1.33
func (m *SafetensorFormat) GetLayerName(n string) (string, error)
func (*SafetensorFormat) GetModelArch ¶ added in v0.1.33
func (m *SafetensorFormat) GetModelArch(name, dirPath string, params *Params) (ModelArch, error)
func (*SafetensorFormat) GetParams ¶ added in v0.1.33
func (m *SafetensorFormat) GetParams(dirpath string) (*Params, error)
func (*SafetensorFormat) GetTensors ¶ added in v0.1.33
type TorchFormat ¶ added in v0.1.33
type TorchFormat struct{}
func (*TorchFormat) GetLayerName ¶ added in v0.1.33
func (m *TorchFormat) GetLayerName(n string) (string, error)
func (*TorchFormat) GetModelArch ¶ added in v0.1.33
func (m *TorchFormat) GetModelArch(name, dirPath string, params *Params) (ModelArch, error)
func (*TorchFormat) GetParams ¶ added in v0.1.33
func (m *TorchFormat) GetParams(dirpath string) (*Params, error)
func (*TorchFormat) GetTensors ¶ added in v0.1.33
type Vocab ¶
Details on gguf's tokenizer can be found at: https://github.com/ggerganov/ggml/blob/master/docs/gguf.md#tokenizer
Source Files ¶
Click to show internal directories.
Click to hide internal directories.