class_docstr: T5-based grapheme-to-phoneme model.
docstr: Runs model inference.
  
  Args:
      Config: configuration file to set up DataLoader
  Returns:
      all_preds: model predictions
docstr_tok: ["Runs","model","inference",".","Args",":","Config",":","configuration","file","to","set","up","DataLoader","Returns",":","all_preds",":","model","predictions"]
code: def _infer(
      self,
      config: DictConfig,
  ) -> List[int]:
      """
      Runs model inference.
  
      Args:
          Config: configuration file to set up DataLoader
      Returns:
          all_preds: model predictions
      """
      # store predictions for all queries in a single list
      all_preds = []
      mode = self.training
      try:
          device = "cuda" if torch.cuda.is_available() else "cpu"
          # Switch model to evaluation mode
          self.eval()
          self.to(device)
  
          infer_datalayer = self._setup_infer_dataloader(
              DictConfig(config)
          )
          for batch in infer_datalayer:
              input_ids, _ = batch
              generated_str, _, _ = self._generate_predictions(
                  input_ids=input_ids.to(device)
              )
  
              all_preds.extend(generated_str)
              del batch
      finally:
          # set mode back to its original value
          self.train(mode=mode)
      return all_preds
  
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 8 for calling the T5G2PModel obj's underlying member method code with example usage: obj._infer(config) and returns: all_preds