code: def __init__(self, models, trg_dict_eos, config):
      super().__init__()
      self.targetlen_cap = config.targetlen_cap
      self.targetlen_a: float = float(config.targetlen_a)
      self.targetlen_b: float = float(config.targetlen_b)
      self.targetlen_c: float = float(config.targetlen_c)
  
      self.beam_search = BeamSearch(
          models,
          trg_dict_eos,
          beam_size=config.beam_size,
          quantize=config.quantize,
          record_attention=config.record_attention,
      )
      self.beam_decode = BeamDecode(
          eos_token_id=trg_dict_eos,
          length_penalty=config.length_penalty,
          nbest=config.nbest,
          beam_size=config.beam_size,
          stop_at_eos=config.stop_at_eos,
      )
  
file_path: pytext/pytext/torchscript/seq2seq/scripted_seq2seq_generator.py
imports: from typing import Dict, List, Optional, Tuple
  import torch
  from pytext.config import ConfigBase
  from pytext.models.module import Module
  from pytext.torchscript.seq2seq.beam_decode import BeamDecode
  from pytext.torchscript.seq2seq.beam_search import BeamSearch
label_desc: Use image node_id 2 to create a new ScriptedSequenceGenerator object from inherited base classes: Module with example: obj = ScriptedSequenceGenerator(models, trg_dict_eos, config)