class_docstr: Base class for TextGeneration Strategy
class_docstr_tok: ["Base","class","for","TextGeneration","Strategy"]
code: def __init__(self, model):
      self.model = model
      if self.model.training:
          # TODO in the future this should raise an exception
          warnings.warn(
              "Generation started while the model is in training mode, switching to eval mode "
              "(this situation may raise an exception in future versions, please call `eval()` before generation)"
          )
          self.model.eval()
      self._end_of_generation_cache = None
  
imports: import abc
  import copy
  import os
  import re
  import warnings
  from typing import List, Set, Tuple
  import torch
  from transformers import CLIPImageProcessor
  from nemo.collections.nlp.modules.common.lm_utils import pad_batch
  from nemo.collections.nlp.modules.common.megatron.utils import get_ltor_masks_and_position_ids
label_desc: Use image node_id 1 to create a new TextGenerationStrategy object  with example: obj = TextGenerationStrategy(model)