class_docstr: Abstract class for tokenizing strategies
class_docstr_tok: ["Abstract","class","for","tokenizing","strategies"]
code: def _tokenize(
      self,
      prompt: str,
      add_eos_token: bool = True,
      strip_bos_token: bool = False,
  ) -> BatchEncoding:
      empty = BatchEncoding(
          data={"input_ids": [], "attention_mask": []}
      )
      if not prompt:
          LOG.warning("Empty text requested for tokenization.")
          return empty
  
      result = self.tokenizer(
          prompt,
          truncation=True,
          max_length=self.max_length,
          padding=False,
          return_tensors=None,
      )
      if len(result["input_ids"]) == 0:
          LOG.warning(
              "Tokenizer result is empty. You may want to audit your dataset"
          )
          return empty
  
      if (
          result["input_ids"][-1] != self.tokenizer.eos_token_id
          and len(result["input_ids"]) < self.max_length
          and add_eos_token
      ):
          result["input_ids"].append(self.tokenizer.eos_token_id)
          result["attention_mask"].append(1)
  
      if (
          result["input_ids"][0] == self.tokenizer.bos_token_id
          and strip_bos_token
      ):
          result["input_ids"] = result["input_ids"][1:]
          result["attention_mask"] = result["attention_mask"][1:]
  
      result["labels"] = result["input_ids"].copy()
      return result
  
imports: import abc
  import copy
  import logging
  from typing import Dict, List, Tuple, Union
  from fastchat.conversation import Conversation
  from transformers import BatchEncoding, PreTrainedTokenizer
  from axolotl.monkeypatch.fastchat_conversation_turns import add_get_turns_to_conversation
  from axolotl.prompters import IGNORE_TOKEN_ID
label_desc: Use image node_id 4 for calling the PromptTokenizingStrategy obj's underlying member method code with example usage: obj._tokenize(prompt, add_eos_token, strip_bos_token) and returns: result, empty, empty