code: def encode(
      self, config: EncodingConfig, text_list: list[str]
  ) -> list[list[int]]:
      # eos_token = self.eos_token if config.add_eos else ""
      # bos_token = self.bos_token if config.add_bos else ""
      # if eos_token != "" or bos_token != "":
      #     text_list = [f"{bos_token}{text}{eos_token}" for text in text_list]
      # The string concatenation above may not always work for all tokenizers (strange).
      # e.g., when codellama's tokenizer is used with "<s>[INST]".
      if config.truncation is not None:
          extra_args = dict(
              truncation=True, max_length=config.truncation
          )
      else:
          extra_args = {}
      input_ids = self.tokenizer(
          text_list,
          add_special_tokens=False,
          **extra_args,
      )["input_ids"]
      bos_token_id = self.tokenizer.bos_token_id
      eos_token_id = self.tokenizer.eos_token_id
      bos_token_ids = (
          [bos_token_id]
          if config.add_bos and bos_token_id is not None
          else []
      )
      eos_token_ids = (
          [eos_token_id]
          if config.add_eos and eos_token_id is not None
          else []
      )
      if len(bos_token_ids) > 0 or len(eos_token_ids) > 0:
          input_ids = [
              bos_token_ids + input_id + eos_token_ids
              for input_id in input_ids
          ]
      return input_ids
  
imports: from dataclasses import dataclass, field
  from enum import Enum
  from typing import Callable, Literal
  import torch
  from transformers import AutoModelForCausalLM, AutoTokenizer
  from transformers import GenerationConfig
  from transformers import PreTrainedModel, PreTrainedTokenizer
label_desc: Use image node_id 4 for calling the TokenizationContext obj's underlying member method code with example usage: obj.encode(config, text_list) and returns: input_ids