class_docstr: Model for end-to-end speech intent classification and slot filling, which is formulated as a speech-to-sequence task
class_docstr_tok: ["Model","for","end-to-end","speech","intent","classification","and","slot","filling",",","which","is","formulated","as","a","speech-to-sequence","task"]
code: def _setup_dataloader_from_config(self, config: Optional[Dict]):
      if "augmentor" in config:
          augmentor = process_augmentations(config["augmentor"])
      else:
          augmentor = None
  
      shuffle = config["shuffle"]
      device = "gpu" if torch.cuda.is_available() else "cpu"
      if config.get("use_dali", False):
          device_id = self.local_rank if device == "gpu" else None
          dataset = audio_to_text_dataset.get_dali_bpe_dataset(
              config=config,
              tokenizer=self.tokenizer,
              shuffle=shuffle,
              device_id=device_id,
              global_rank=self.global_rank,
              world_size=self.world_size,
              preprocessor_cfg=self._cfg.preprocessor,
          )
          return dataset
  
      # Instantiate tarred dataset loader or normal dataset loader
      if config.get("is_tarred", False):
          if (
              "tarred_audio_filepaths" in config
              and config["tarred_audio_filepaths"] is None
          ) or (
              "manifest_filepath" in config
              and config["manifest_filepath"] is None
          ):
              logging.warning(
                  "Could not load dataset as `manifest_filepath` was None or "
                  f"`tarred_audio_filepaths` is None. Provided config : {config}"
              )
              return None
  
          shuffle_n = (
              config.get("shuffle_n", 4 * config["batch_size"])
              if shuffle
              else 0
          )
          dataset = audio_to_text_dataset.get_tarred_dataset(
              config=config,
              tokenizer=self.tokenizer,
              shuffle_n=shuffle_n,
              global_rank=self.global_rank,
              world_size=self.world_size,
              augmentor=augmentor,
          )
          shuffle = False
      else:
          if (
              "manifest_filepath" in config
              and config["manifest_filepath"] is None
          ):
              logging.warning(
                  f"Could not load dataset as `manifest_filepath` was None. Provided config : {config}"
              )
              return None
  
          dataset = audio_to_text_dataset.get_bpe_dataset(
              config=config,
              tokenizer=self.tokenizer,
              augmentor=augmentor,
          )
      if hasattr(dataset, "collate_fn"):
          collate_fn = dataset.collate_fn
      elif hasattr(dataset.datasets[0], "collate_fn"):
          # support datasets that are lists of entries
          collate_fn = dataset.datasets[0].collate_fn
      else:
          # support datasets that are lists of lists
          collate_fn = dataset.datasets[0].datasets[0].collate_fn
  
      return torch.utils.data.DataLoader(
          dataset=dataset,
          batch_size=config["batch_size"],
          collate_fn=collate_fn,
          drop_last=config.get("drop_last", False),
          shuffle=shuffle,
          num_workers=config.get("num_workers", 0),
          pin_memory=config.get("pin_memory", False),
      )
  
imports: import json
  import os
  import tempfile
  from math import ceil
  from typing import Dict, List, Optional, Union
  import torch
  from omegaconf import DictConfig, OmegaConf, open_dict
  from tqdm.auto import tqdm
  from nemo.collections.asr.data import audio_to_text_dataset
  from nemo.collections.asr.data.audio_to_text_dali import DALIOutputs
  from nemo.collections.asr.metrics.wer import WER
  from nemo.collections.asr.models.asr_model import ASRModel, ExportableEncDecModel
  from nemo.collections.asr.parts.mixins import ASRBPEMixin, ASRModuleMixin
  from nemo.collections.asr.parts.preprocessing.perturb import process_augmentations
  from nemo.collections.asr.parts.submodules.ctc_decoding import CTCBPEDecoding, CTCBPEDecodingConfig
  from nemo.collections.asr.parts.utils.slu_utils import SequenceGenerator, SequenceGeneratorConfig, get_seq_mask
  from nemo.collections.common.losses import SmoothedNLLLoss
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types import AudioSignal, LabelsType, LengthsType, LogprobsType, NeuralType, SpectrogramType
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 12 for calling the SLUIntentSlotBPEModel obj's underlying member method code with example usage: obj._setup_dataloader_from_config(config) and returns: torch, dataset, None, None