class_docstr: Dataset for Causal Language modeling.
code: def _get_sample_encoding(
      self, system: str, prompt: str, answer: str
  ) -> List:
      if len(system) > 0:
          system_encoding = self.encode(
              self.tokenizer,
              system,
              self.cfg.tokenizer.max_length_prompt,
              "right",
          )["input_ids"]
      else:
          system_encoding = torch.empty(0)
      prompt_encoding = self.encode(
          self.tokenizer,
          prompt,
          self.cfg.tokenizer.max_length_prompt,
          "left",
      )["input_ids"]
      max_length_answer = self.cfg.tokenizer.max_length_answer - int(
          self.cfg.dataset.add_eos_token_to_answer
      )
      answer_encoding = self.encode(
          self.tokenizer, answer, max_length_answer, "right"
      )["input_ids"]
      if self.cfg.dataset.add_eos_token_to_answer:
          answer_encoding = torch.cat(
              [
                  answer_encoding,
                  torch.Tensor([self.tokenizer.eos_token_id]),
              ],
              dim=0,
          )
  
      return [system_encoding, prompt_encoding, answer_encoding]
  
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 18 for calling the CustomDataset obj's underlying member method code with example usage: obj._get_sample_encoding(system, prompt, answer) and returns: list