Documentation
¶
Index ¶
- func New(c fs.Config) (model.Model, error)
- type ImageProcessor
- type Model
- type PatchEmbedding
- type Projector
- type TextAttention
- type TextExperts
- type TextFeedForward
- type TextLayer
- type TextMLP
- type TextMOE
- type TextModel
- type TextOptions
- type VisionAdapter
- type VisionAttention
- type VisionLayer
- type VisionMLP
- type VisionModel
- type VisionOptions
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 ¶
type Model ¶
type Model struct {
model.Base
model.BytePairEncoding
ImageProcessor
*VisionModel `gguf:"v"`
*Projector `gguf:"mm"`
*TextModel
}
func (*Model) EncodeMultimodal ¶
type PatchEmbedding ¶
func (*PatchEmbedding) Forward ¶
func (p *PatchEmbedding) Forward(ctx ml.Context, hiddenStates ml.Tensor, opts *VisionOptions) ml.Tensor
type TextAttention ¶
type TextExperts ¶
type TextExperts struct {
Gate *nn.LinearBatch `gguf:"ffn_gate_exps"`
Up *nn.LinearBatch `gguf:"ffn_up_exps"`
Down *nn.LinearBatch `gguf:"ffn_down_exps"`
}
func (*TextExperts) Forward ¶
func (e *TextExperts) Forward(ctx ml.Context, hiddenStates, routerLogits ml.Tensor, opts *TextOptions) ml.Tensor
type TextFeedForward ¶
type TextLayer ¶
type TextLayer struct {
AttentionNorm *nn.LayerNorm `gguf:"attn_norm"`
Attention *TextAttention
FFNNorm *nn.LayerNorm `gguf:"ffn_norm"`
FeedForward TextFeedForward
}
type TextMLP ¶
type TextMOE ¶
type TextMOE struct {
Router *nn.Linear `gguf:"ffn_gate_inp"`
Experts *TextExperts
}
type TextModel ¶
type TextModel struct {
Layers []TextLayer `gguf:"blk"`
TokenEmbedding *nn.Embedding `gguf:"token_embd"`
OutputNorm *nn.LayerNorm `gguf:"output_norm"`
Output *nn.Linear `gguf:"output,alt:token_embd"`
*TextOptions
}
type TextOptions ¶
type TextOptions struct {
// contains filtered or unexported fields
}
type VisionAdapter ¶
func (*VisionAdapter) Forward ¶
func (a *VisionAdapter) Forward(ctx ml.Context, hiddenStates ml.Tensor, opts *VisionOptions) ml.Tensor
type VisionAttention ¶
type VisionAttention 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 (*VisionAttention) Forward ¶
func (sa *VisionAttention) Forward(ctx ml.Context, hiddenState, cos, sin ml.Tensor, opts *VisionOptions) ml.Tensor
type VisionLayer ¶
type VisionLayer struct {
InputLayerNorm *nn.LayerNorm `gguf:"attn_norm"`
*VisionAttention
PostAttentionNorm *nn.LayerNorm `gguf:"ffn_norm"`
*VisionMLP `gguf:"mlp"`
}
func (*VisionLayer) Forward ¶
func (e *VisionLayer) Forward(ctx ml.Context, hiddenStates, cos, sin ml.Tensor, opts *VisionOptions) ml.Tensor
type VisionModel ¶
type VisionModel struct {
Layers []VisionLayer `gguf:"blk"`
*PatchEmbedding `gguf:"patch_embedding"`
ClassEmbedding ml.Tensor `gguf:"class_embedding"`
PositionalEmbedding ml.Tensor `gguf:"positional_embedding_vlm"`
LayerNormPre *nn.LayerNorm `gguf:"layernorm_pre"`
LayerNormPost *nn.LayerNorm `gguf:"layernorm_post"`
*VisionAdapter `gguf:"vision_adapter"`
*VisionOptions
}
type VisionOptions ¶
type VisionOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.