Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ImageProcessor ¶
type ImageProcessor struct {
// contains filtered or unexported fields
}
func (ImageProcessor) ProcessImage ¶
func (p ImageProcessor) ProcessImage(img image.Image) ([]float32, error)
type Model ¶
type Model struct { model.Base model.SentencePieceModel *VisionModel `gguf:"v,vision"` *TextModel *MultiModalProjector `gguf:"mm"` ImageProcessor }
func (*Model) EncodeMultimodal ¶
type MultiModalProjector ¶
type TextLayer ¶
type TextMLP ¶
type TextModel ¶
type TextModel struct { model.Base model.SentencePieceModel TokenEmbedding *nn.Embedding `gguf:"token_embd"` Layers []TextLayer `gguf:"blk"` OutputNorm *nn.RMSNorm `gguf:"output_norm"` Output *nn.Linear `gguf:"output,alt:token_embd"` *TextOptions }
type TextOptions ¶
type TextOptions struct {
// contains filtered or unexported fields
}
type TextSelfAttention ¶
type VisionEncoderLayer ¶
type VisionEncoderLayer struct { LayerNorm1 *nn.LayerNorm `gguf:"layer_norm1"` SelfAttention *VisionSelfAttention LayerNorm2 *nn.LayerNorm `gguf:"layer_norm2"` MLP *VisionMLP `gguf:"mlp"` }
func (*VisionEncoderLayer) Forward ¶
func (e *VisionEncoderLayer) Forward(ctx ml.Context, hiddenState ml.Tensor, opts *VisionModelOptions) ml.Tensor
type VisionModel ¶
type VisionModel struct { PatchEmbedding *nn.Conv2D `gguf:"patch_embedding"` PositionEmbedding *nn.Embedding `gguf:"position_embedding"` PostLayerNorm *nn.LayerNorm `gguf:"post_layernorm"` Layers []VisionEncoderLayer `gguf:"blk"` *VisionModelOptions }
type VisionModelOptions ¶
type VisionModelOptions struct {
// contains filtered or unexported fields
}
type VisionSelfAttention ¶
type VisionSelfAttention struct { Query *nn.Linear `gguf:"attn_q"` Key *nn.Linear `gguf:"attn_k"` Value *nn.Linear `gguf:"attn_v"` Output *nn.Linear `gguf:"attn_output"` }
func (*VisionSelfAttention) Forward ¶
func (sa *VisionSelfAttention) Forward(ctx ml.Context, hiddenState ml.Tensor, opts *VisionModelOptions) ml.Tensor
Click to show internal directories.
Click to hide internal directories.