class_docstr: Tokenizing strategy for instruction-based prompts.
class_docstr_tok: ["Tokenizing","strategy","for","instruction-based","prompts","."]
code: def tokenize_prompt(self, prompt):
      (
          instruction,
          input,  # pylint: disable=redefined-builtin
          response,
      ) = self.parse_instruction_fields(prompt)
      user_prompt = next(
          iter(
              self.prompter.build_prompt(
                  instruction,
                  input,
              )
          )
      )
      tokenized_prompt = self._tokenize(
          user_prompt, add_eos_token=False
      )
      if not self.train_on_inputs:
          user_prompt_len = len(tokenized_prompt["input_ids"])
          # TODO this could be sped up using numpy array slicing
          tokenized_prompt["labels"] = [IGNORE_INDEX] * user_prompt_len
      tokenized_res_prompt = self._tokenize(
          response, strip_bos_token=True, add_eos_token=True
      )
      tokenized_prompt["input_ids"] += tokenized_res_prompt["input_ids"]
      tokenized_prompt["attention_mask"] += tokenized_res_prompt[
          "attention_mask"
      ]
      tokenized_prompt["labels"] += tokenized_res_prompt["input_ids"]
  
      return tokenized_prompt
  
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 2 for calling the InstructionPromptTokenizingStrategy obj's underlying member method code with example usage: obj.tokenize_prompt(prompt) and returns: tokenized_prompt