Documentation
¶
Index ¶
- Constants
- Variables
- func Init() error
- type ContainerGGLA
- type ContainerGGUF
- type DetokenizeRequest
- type DetokenizeResponse
- type EmbeddingRequest
- type EmbeddingResponse
- type GGML
- type GGUFModel
- func (llm *GGUFModel) Decode(rso *readSeekOffset) error
- func (llm *GGUFModel) Encode(f *os.File) error
- func (llm *GGUFModel) FileType() string
- func (llm *GGUFModel) ModelFamily() string
- func (llm *GGUFModel) ModelType() string
- func (llm *GGUFModel) NumCtx() uint32
- func (llm *GGUFModel) NumEmbed() uint32
- func (llm *GGUFModel) NumGQA() uint32
- func (llm *GGUFModel) NumHead() uint32
- func (llm *GGUFModel) NumHeadKv() uint32
- func (llm *GGUFModel) NumKV() uint64
- func (llm *GGUFModel) NumLayers() uint32
- func (llm *GGUFModel) NumTensor() uint64
- type ImageData
- type KV
- type LLM
- type ModelGGLA
- func (*ModelGGLA) FileType() string
- func (m *ModelGGLA) KV() KV
- func (*ModelGGLA) ModelFamily() string
- func (*ModelGGLA) ModelType() string
- func (*ModelGGLA) NumCtx() uint32
- func (*ModelGGLA) NumEmbed() uint32
- func (*ModelGGLA) NumGQA() uint32
- func (*ModelGGLA) NumHead() uint32
- func (*ModelGGLA) NumHeadKv() uint32
- func (*ModelGGLA) NumLayers() uint32
- func (m *ModelGGLA) Tensor() []Tensor
- type PredictOpts
- type PredictResult
- type Tensor
- type TokenizeRequest
- type TokenizeResponse
Constants ¶
View Source
const ( // Magic constant for `ggml` files (unversioned). FILE_MAGIC_GGML = 0x67676d6c // Magic constant for `ggml` files (versioned, ggmf). FILE_MAGIC_GGMF = 0x67676d66 // Magic constant for `ggml` files (versioned, ggjt). FILE_MAGIC_GGJT = 0x67676a74 // Magic constant for `ggla` files (LoRA adapter). FILE_MAGIC_GGLA = 0x67676C61 // Magic constant for `gguf` files (versioned, gguf) FILE_MAGIC_GGUF_LE = 0x46554747 FILE_MAGIC_GGUF_BE = 0x47475546 )
View Source
const ( GGUFTokenNormal uint32 GGUFTokenUnknown GGUFTokenControl GGUFTokenUserDefined GGUFTokenUnused GGUFTokenByte )
View Source
const ( GGUFTypeUint8 uint32 = iota GGUFTypeInt8 GGUFTypeUint16 GGUFTypeInt16 GGUFTypeUint32 GGUFTypeInt32 GGUFTypeFloat32 GGUFTypeBool GGUFTypeString GGUFTypeArray GGUFTypeUint64 GGUFTypeInt64 GGUFTypeFloat64 )
Variables ¶
View Source
var ErrUnsupportedFormat = errors.New("unsupported model format")
Functions ¶
Types ¶
type ContainerGGLA ¶ added in v0.1.29
type ContainerGGLA struct {
// contains filtered or unexported fields
}
func (*ContainerGGLA) Decode ¶ added in v0.1.29
func (c *ContainerGGLA) Decode(rso *readSeekOffset) (model, error)
func (*ContainerGGLA) Name ¶ added in v0.1.29
func (c *ContainerGGLA) Name() string
type ContainerGGUF ¶ added in v0.1.29
type ContainerGGUF struct { ByteOrder binary.ByteOrder Version uint32 V1 struct { NumTensor uint32 NumKV uint32 } V2 struct { NumTensor uint64 NumKV uint64 } V3 struct { NumTensor uint64 NumKV uint64 } }
func (*ContainerGGUF) Decode ¶ added in v0.1.29
func (c *ContainerGGUF) Decode(rso *readSeekOffset) (model, error)
func (*ContainerGGUF) Name ¶ added in v0.1.29
func (c *ContainerGGUF) Name() string
type DetokenizeRequest ¶ added in v0.0.18
type DetokenizeRequest struct {
Tokens []int `json:"tokens"`
}
type DetokenizeResponse ¶ added in v0.0.18
type DetokenizeResponse struct {
Content string `json:"content"`
}
type EmbeddingRequest ¶ added in v0.0.18
type EmbeddingRequest struct {
Content string `json:"content"`
}
type EmbeddingResponse ¶ added in v0.0.18
type EmbeddingResponse struct {
Embedding []float64 `json:"embedding"`
}
type GGML ¶
type GGML struct { Size int64 // contains filtered or unexported fields }
func DecodeGGML ¶
func DecodeGGML(r io.ReadSeeker) (*GGML, error)
type GGUFModel ¶ added in v0.1.29
type GGUFModel struct { *ContainerGGUF KV Tensors []Tensor // contains filtered or unexported fields }
func NewGGUFModel ¶ added in v0.1.29
func NewGGUFModel(container *ContainerGGUF) *GGUFModel
func (*GGUFModel) ModelFamily ¶ added in v0.1.29
type LLM ¶
type ModelGGLA ¶ added in v0.1.29
type ModelGGLA struct { *ContainerGGLA // contains filtered or unexported fields }
func (*ModelGGLA) ModelFamily ¶ added in v0.1.29
type PredictOpts ¶ added in v0.1.14
type PredictResult ¶ added in v0.1.14
type Tensor ¶ added in v0.1.29
type Tensor struct { Name string Kind uint32 Offset uint64 // shape is the number of elements in each dimension Shape []uint64 FileName string OffsetPadding uint64 FileOffsets []uint64 }
func (Tensor) Parameters ¶ added in v0.1.29
type TokenizeRequest ¶ added in v0.0.18
type TokenizeRequest struct {
Content string `json:"content"`
}
type TokenizeResponse ¶ added in v0.0.18
type TokenizeResponse struct {
Tokens []int `json:"tokens"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.