> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/automodel/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/automodel/_mcp/server.

# nemo_automodel.components.models.qwen2.state_dict_adapter

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

| Name                                                                                                        | Description                          |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| [`Qwen2StateDictAdapter`](#nemo_automodel-components-models-qwen2-state_dict_adapter-Qwen2StateDictAdapter) | State dict adapter for Qwen2 models. |

### Data

[`logger`](#nemo_automodel-components-models-qwen2-state_dict_adapter-logger)

### API

```python
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).

```python
nemo_automodel.components.models.qwen2.state_dict_adapter.Qwen2StateDictAdapter.from_hf(
    hf_state_dict: dict[str, typing.Any],
    kwargs = {}
) -> dict[str, typing.Any]
```

```python
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]
```

```python
nemo_automodel.components.models.qwen2.state_dict_adapter.logger = logging.getLogger(__name__)
```