nemo_automodel.components.models.qwen2.state_dict_adapter

View as Markdown

State dict adapter for Qwen2 model.

The model uses separate q/k/v and gate/up projections that match HuggingFace key names exactly, so the adapter is a passthrough (only tied-weight handling in from_hf).

Module Contents

Classes

NameDescription
Qwen2StateDictAdapterState dict adapter for Qwen2 models.

Data

logger

API

class nemo_automodel.components.models.qwen2.state_dict_adapter.Qwen2StateDictAdapter(
config: transformers.Qwen2Config
)

State dict adapter for Qwen2 models.

Uses separate projections that match HuggingFace key names exactly, so from_hf / to_hf are simple passthroughs (only tied-weight handling in from_hf).

nemo_automodel.components.models.qwen2.state_dict_adapter.Qwen2StateDictAdapter.from_hf(
hf_state_dict: dict[str, typing.Any],
kwargs = {}
) -> dict[str, typing.Any]
nemo_automodel.components.models.qwen2.state_dict_adapter.Qwen2StateDictAdapter.to_hf(
state_dict: dict[str, typing.Any],
exclude_key_regex: typing.Optional[str] = None,
kwargs = {}
) -> dict[str, typing.Any]
nemo_automodel.components.models.qwen2.state_dict_adapter.logger = logging.getLogger(__name__)