code: def tokenize_prompt(tokenizer, prompt, tokenizer_max_length=None):
      if tokenizer_max_length is not None:
          max_length = tokenizer_max_length
      else:
          max_length = tokenizer.model_max_length
  
      text_inputs = tokenizer(
          prompt,
          truncation=True,
          padding="max_length",
          max_length=max_length,
          return_tensors="pt",
      )
  
      return text_inputs
  
imports: import hashlib
  import itertools
  import os
  from pathlib import Path
  from typing import Dict
  import torch
  from diffusers import AutoencoderKL, DDPMScheduler, DiffusionPipeline, StableDiffusionXLPipeline, UNet2DConditionModel
  from diffusers.utils.import_utils import is_xformers_available
  from packaging import version
  from tqdm import tqdm
  from transformers import AutoTokenizer, PretrainedConfig
  from autotrain import logger
  from autotrain.trainers.dreambooth.datasets import PromptDataset
label_desc: Use image node_id 3 for calling a global function with example usage: tokenize_prompt(tokenizer, prompt, tokenizer_max_length) and returns: text_inputs