mstar.model.command_a_plus.config

Contents

mstar.model.command_a_plus.config#

Classes

CommandAPlusConfig(text_config, vision_config)

The outer Cohere2 Vision checkpoint configuration.

CommandAPlusTextConfig(vocab_size, ...)

CommandAPlusVisionConfig(hidden_size, ...)

The SigLIP tower, pixel shuffle and SwiGLU projector that feed image tiles to the LLM.

class mstar.model.command_a_plus.config.CommandAPlusConfig(text_config, vision_config)[source]#

Bases: object

The outer Cohere2 Vision checkpoint configuration.

Parameters:
classmethod from_dict(data)[source]#
Parameters:

data (dict)

Return type:

CommandAPlusConfig

classmethod from_json(path)[source]#

Load a local config.json without resolving or downloading weights.

Parameters:

path (str | Path)

Return type:

CommandAPlusConfig

text_config: CommandAPlusTextConfig#
vision_config: CommandAPlusVisionConfig#
class mstar.model.command_a_plus.config.CommandAPlusTextConfig(vocab_size: int, hidden_size: int, num_hidden_layers: int, num_attention_heads: int, num_key_value_heads: int, head_dim: int, intermediate_size: int, num_experts: int, num_experts_per_tok: int, num_shared_experts: int, layer_types: list[str], sliding_window: int, max_position_embeddings: int, rope_theta: float, layer_norm_eps: float, logit_scale: float, bos_token_id: int, eos_token_id: int, pad_token_id: int)[source]#

Bases: object

Parameters:
  • vocab_size (int)

  • hidden_size (int)

  • num_hidden_layers (int)

  • num_attention_heads (int)

  • num_key_value_heads (int)

  • head_dim (int)

  • intermediate_size (int)

  • num_experts (int)

  • num_experts_per_tok (int)

  • num_shared_experts (int)

  • layer_types (list[str])

  • sliding_window (int)

  • max_position_embeddings (int)

  • rope_theta (float)

  • layer_norm_eps (float)

  • logit_scale (float)

  • bos_token_id (int)

  • eos_token_id (int)

  • pad_token_id (int)

bos_token_id: int#
eos_token_id: int#
classmethod from_dict(data)[source]#

Parse the text config; shapes are checked when weights load, so only the math is pinned here.

Parameters:

data (dict)

Return type:

CommandAPlusTextConfig

head_dim: int#
hidden_size: int#
intermediate_size: int#
layer_norm_eps: float#
layer_types: list[str]#
logit_scale: float#
max_position_embeddings: int#
num_attention_heads: int#
num_experts: int#
num_experts_per_tok: int#
num_hidden_layers: int#
num_key_value_heads: int#
num_shared_experts: int#
pad_token_id: int#
rope_theta: float#
property shared_intermediate_size: int#

Width of the shared MLP, derived from the expert dimensions.

sliding_window: int#
vocab_size: int#
class mstar.model.command_a_plus.config.CommandAPlusVisionConfig(hidden_size, intermediate_size, num_hidden_layers, num_attention_heads, image_size, patch_size, layer_norm_eps, downsample_factor, alignment_intermediate_size, image_token_id)[source]#

Bases: object

The SigLIP tower, pixel shuffle and SwiGLU projector that feed image tiles to the LLM.

Parameters:
  • hidden_size (int)

  • intermediate_size (int)

  • num_hidden_layers (int)

  • num_attention_heads (int)

  • image_size (int)

  • patch_size (int)

  • layer_norm_eps (float)

  • downsample_factor (int)

  • alignment_intermediate_size (int)

  • image_token_id (int)

alignment_intermediate_size: int#
downsample_factor: int#
classmethod from_dict(data)[source]#

data is the whole checkpoint config; the tower’s own fields sit in vision_config.

Parameters:

data (dict)

Return type:

CommandAPlusVisionConfig

hidden_size: int#
image_size: int#
image_token_id: int#
intermediate_size: int#
layer_norm_eps: float#
num_attention_heads: int#
num_hidden_layers: int#
patch_size: int#
property tokens_per_tile: int#