nemo_automodel.components.models.llama.state_dict_adapter
nemo_automodel.components.models.llama.state_dict_adapter
State dict adapter for Llama model.
The model uses separate q_proj / k_proj / v_proj / gate_proj / up_proj that match HuggingFace key names exactly, so the adapter is a passthrough (only tied-weight handling is applied in from_hf).
Module Contents
Classes
Data
API
Bases: StateDictAdapter
State dict adapter for Llama models.
Subclassing the common interface makes the adapter checkpoint-compatible; load-path policy remains entirely inside the checkpoint package.
Uses separate projections that match HuggingFace key names exactly, so from_hf / to_hf are simple passthroughs (only tied-weight handling in from_hf).
Return one Llama tensor under its unchanged HF state-dict key.
Parameters:
Fully-qualified HF state-dict key. The key determines the tensor’s rank and axis order.
Tensor/value to export. This passthrough does not copy or transform it.
Optional controls, including exclude_key_regex to skip matching keys.
Returns: list[tuple[str, Any]]
A single (fqn, tensor) tuple, or an empty list when filtered. The returned tensor aliases the input.