parseMultimodalConfig (qwen3_5/vision.go)

ollama · mlxrunner/model/qwen3_5/vision.go · go · MIT
ai, tag:knn-classified

Parses multimodal config and provides a VisionAdapter for Qwen3.5 vision models.

// Source: https://github.com/ollama/ollama | License: MIT | Copyright Ollama
// Provided via justclaw.it.com; keep this notice with the code.
package qwen3_5

import (
	"encoding/json"
	"fmt"
	"math"

	"github.com/ollama/ollama/mlx"
	"github.com/ollama/ollama/mlxrunner/batch"
	"github.com/ollama/ollama/mlxrunner/model"
	"github.com/ollama/ollama/mlxrunner/nn"
)

// VisionConfig holds the qwen3.5 vision tower configuration.
type VisionConfig struct {
	Depth                 int32 `json:"depth"`
	HiddenSize            int32 `json:"hidden_size"`
	NumHeads              int32 `json:"num_heads"`
	InChannels            int32 `json:"in_channels"`
	PatchSize             int32 `json:"patch_size"`
	SpatialMergeSize      int32 `json:"spatial_merge_size"`
	TemporalPatchSize     int32 `json:"temporal_pa

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key