class_docstr: Represents a sequence generator.
class_docstr_tok: ["Represents","a","sequence","generator","."]
docstr: :param model:
      The decoder model to use for generation.
docstr_tok: [":","param","model",":","The","decoder","model","to","use","for","generation","."]
code: def __init__(self, model: DecoderModel) -> None:
      """
      :param model:
          The decoder model to use for generation.
      """
      if model.vocab_info.eos_idx is None:
          raise ValueError(
              "`model.vocab_info` must have `eos_idx` set for sequence generation."
          )
  
      model.eval()
  
      self.model = model
  
      self._step_hooks = OrderedDict()
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from collections import OrderedDict
  from dataclasses import dataclass
  from typing import Dict, List, Optional, Protocol
  from torch import Tensor
  from torch.utils.hooks import RemovableHandle
  from fairseq2.models.decoder import DecoderModel
  from fairseq2.models.encoder_decoder import EncoderDecoderModel
  from fairseq2.nn.padding import PaddingMask
label_desc: Use image node_id 1 to create a new SequenceGenerator object from inherited base classes: ABC with example: obj = SequenceGenerator(model)