> 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.speculative.eagle.target_v12

Target-model wrapper for EAGLE-1 / EAGLE-2 training.

## Module Contents

### Classes

| Name                                                                                               | Description                                                          |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [`EagleTargetBatch`](#nemo_automodel-components-speculative-eagle-target_v12-EagleTargetBatch)     | Target-model outputs needed by the EAGLE-1 / EAGLE-2 trainer.        |
| [`HFEagleTargetModel`](#nemo_automodel-components-speculative-eagle-target_v12-HFEagleTargetModel) | Thin wrapper that exposes hidden-state supervision from a causal LM. |

### Functions

| Name                                                                                                     | Description                                                  |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [`_shift_left_with_zero`](#nemo_automodel-components-speculative-eagle-target_v12-_shift_left_with_zero) | Shift a batched sequence tensor left and zero-fill the tail. |

### API

```python
class nemo_automodel.components.speculative.eagle.target_v12.EagleTargetBatch(
    input_hidden_states: torch.Tensor,
    target_hidden_states: torch.Tensor,
    target_logits: torch.Tensor,
    input_ids: torch.Tensor,
    attention_mask: torch.Tensor,
    loss_mask: torch.Tensor
)
```

Dataclass

Target-model outputs needed by the EAGLE-1 / EAGLE-2 trainer.

```python
class nemo_automodel.components.speculative.eagle.target_v12.HFEagleTargetModel(
    model: torch.nn.Module
)
```

Thin wrapper that exposes hidden-state supervision from a causal LM.

```python
nemo_automodel.components.speculative.eagle.target_v12.HFEagleTargetModel.generate_batch(
    input_ids: torch.Tensor,
    attention_mask: torch.Tensor,
    loss_mask: torch.Tensor
) -> nemo_automodel.components.speculative.eagle.target_v12.EagleTargetBatch
```

Run the target transformer and prepare shifted supervision tensors.

```python
nemo_automodel.components.speculative.eagle.target_v12.HFEagleTargetModel.get_input_embeddings() -> torch.nn.Embedding
```

Return the target model input embeddings.

```python
nemo_automodel.components.speculative.eagle.target_v12.HFEagleTargetModel.get_lm_head() -> torch.nn.Module
```

Return the target model lm\_head.

```python
nemo_automodel.components.speculative.eagle.target_v12._shift_left_with_zero(
    tensor: torch.Tensor
) -> torch.Tensor
```

Shift a batched sequence tensor left and zero-fill the tail.