class_docstr: T5-based grapheme-to-phoneme model.
docstr: Generates predictions and converts IDs to text.
docstr_tok: ["Generates","predictions","and","converts","IDs","to","text","."]
code: def _generate_predictions(
      self, input_ids: torch.Tensor, model_max_target_len: int = 512
  ):
      """
      Generates predictions and converts IDs to text.
      """
      outputs = self.model.generate(
          input_ids,
          output_scores=True,
          return_dict_in_generate=True,
          max_length=model_max_target_len,
      )
      generated_ids, sequence_toks_scores = (
          outputs["sequences"],
          outputs["scores"],
      )
      generated_texts = self._tokenizer.batch_decode(
          generated_ids, skip_special_tokens=True
      )
  
      return generated_texts, generated_ids, sequence_toks_scores
  
imports: from dataclasses import dataclass
  from typing import Any, Dict, List, Optional, Union
  import torch
  from hydra.utils import instantiate
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from transformers import AutoTokenizer, T5ForConditionalGeneration
  from nemo.collections.asr.metrics.wer import word_error_rate
  from nemo.collections.tts.g2p.data.t5 import T5G2PDataset
  from nemo.collections.tts.models.base import G2PModel
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types import LabelsType, LossType, MaskType, NeuralType, TokenIndex
  from nemo.utils import logging
label_desc: Use image node_id 13 for calling the T5G2PModel obj's underlying member method code with example usage: obj._generate_predictions(input_ids, model_max_target_len) and returns: generated_texts,  generated_ids,  sequence_toks_scores