class_docstr: Dataset for Causal Language modeling.
code: def clean_output(
      output: Dict,
      cfg: Any,
  ):
      output["predicted_text"] = output["predicted_text"].tolist()
      for j in range(len(output["predicted_text"])):
          curr_text = output["predicted_text"][j].strip()
          for stop_token in cfg.tokenizer._stop_words:
              if curr_text.find(stop_token) != -1:
                  curr_text = curr_text[: curr_text.find(stop_token)]
          output["predicted_text"][j] = curr_text.strip()
  
      return output
  
imports: import codecs
  import collections.abc
  import logging
  from typing import Any, Dict, List, Tuple, Union
  import numpy
  import pandas
  import torch
  from torch.utils.data import Dataset
  from llm_studio.src.datasets.conversation_chain_handler import ConversationChainHandler
  from llm_studio.src.datasets.text_utils import get_tokenizer
label_desc: Use image node_id 11 for calling the CustomDataset obj's underlying member method code with example usage: obj.clean_output(output, cfg) and returns: output