class_docstr: Load Textual Inversion tokens and embeddings to the tokenizer and text encoder.
code: def _check_text_inv_inputs(
      self,
      tokenizer,
      text_encoder,
      pretrained_model_name_or_paths,
      tokens,
  ):
      if tokenizer is None:
          raise ValueError(
              f"{self.__class__.__name__} requires `self.tokenizer` or passing a `tokenizer` of type `PreTrainedTokenizer` for calling"
              f" `{self.load_textual_inversion.__name__}`"
          )
  
      if text_encoder is None:
          raise ValueError(
              f"{self.__class__.__name__} requires `self.text_encoder` or passing a `text_encoder` of type `PreTrainedModel` for calling"
              f" `{self.load_textual_inversion.__name__}`"
          )
  
      if len(pretrained_model_name_or_paths) > 1 and len(
          pretrained_model_name_or_paths
      ) != len(tokens):
          raise ValueError(
              f"You have passed a list of models of length {len(pretrained_model_name_or_paths)}, and list of tokens of length {len(tokens)} "
              f"Make sure both lists have the same length."
          )
  
      valid_tokens = [t for t in tokens if t is not None]
      if len(set(valid_tokens)) < len(valid_tokens):
          raise ValueError(
              f"You have passed a list of tokens that contains duplicates: {tokens}"
          )
  
file_path: diffusers/src/diffusers/loaders/textual_inversion.py
imports: from typing import Dict, List, Optional, Union
  import safetensors
  import torch
  from huggingface_hub.utils import validate_hf_hub_args
  from torch import nn
  from ..utils import _get_model_file, is_accelerate_available, is_transformers_available, logging
label_desc: Use image node_id 3 for calling the TextualInversionLoaderMixin obj's underlying member method code with example usage: obj._check_text_inv_inputs(tokenizer, text_encoder, pretrained_model_name_or_paths, tokens) without return types