docstr: Setup function for a infer data loader.
  
  Args:
      cfg: config dictionary containing data loader params like batch_size, num_workers and pin_memory
      queries: text
      max_seq_length: maximum length of queries, default is -1 for no limit
  Returns:
      A pytorch DataLoader.
docstr_tok: ["Setup","function","for","a","infer","data","loader",".","Args",":","cfg",":","config","dictionary","containing","data","loader","params","like","batch_size",",","num_workers","and","pin_memory","queries",":","text","max_seq_length",":","maximum","length","of","queries",",","default","is","-1","for","no","limit","Returns",":","A","pytorch","DataLoader","."]
code: def _setup_infer_dataloader(
      self, cfg: Dict, queries: List[str], max_seq_length: int = -1
  ) -> "torch.utils.data.DataLoader":
      """
      Setup function for a infer data loader.
  
      Args:
          cfg: config dictionary containing data loader params like batch_size, num_workers and pin_memory
          queries: text
          max_seq_length: maximum length of queries, default is -1 for no limit
      Returns:
          A pytorch DataLoader.
      """
      dataset = TextClassificationDataset(
          tokenizer=self.tokenizer,
          queries=queries,
          max_seq_length=max_seq_length,
      )
      return torch.utils.data.DataLoader(
          dataset=dataset,
          batch_size=cfg["batch_size"],
          shuffle=False,
          num_workers=cfg.get("num_workers", 0),
          pin_memory=cfg.get("pin_memory", False),
          drop_last=False,
          collate_fn=dataset.collate_fn,
      )
  
imports: import os
  from typing import Dict, List, Optional
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.common.losses import CrossEntropyLoss
  from nemo.collections.nlp.data.text_classification import TextClassificationDataset, calc_class_weights
  from nemo.collections.nlp.metrics.classification_report import ClassificationReport
  from nemo.collections.nlp.models.nlp_model import NLPModel
  from nemo.collections.nlp.modules.common import SequenceClassifier
  from nemo.collections.nlp.parts.utils_funcs import tensor2list
  from nemo.core.classes.common import typecheck
  from nemo.core.classes.exportable import Exportable
  from nemo.utils import logging
label_desc: Use image node_id 14 for calling the TextClassificationModel obj's underlying member method code with example usage: obj._setup_infer_dataloader(cfg, queries, max_seq_length) and returns: torch