code: def _initialize_transformer_components(
      transformer_model, num_classes: int, cache_dir: str
  ):
      from_pretrained_options = (
          _get_arguments_for_from_pretrained_model(
              transformer_model.model_loading_strategy
          )
      )
  
      config = AutoConfig.from_pretrained(
          transformer_model.config,
          num_labels=num_classes,
          cache_dir=cache_dir,
          force_download=from_pretrained_options.force_download,
      )
  
      tokenizer = AutoTokenizer.from_pretrained(
          transformer_model.tokenizer,
          cache_dir=cache_dir,
          force_download=from_pretrained_options.force_download,
      )
  
      # Suppress "Some weights of the model checkpoint at [model name] were not [...]"-warnings
      previous_verbosity = transformers_logging.get_verbosity()
      transformers_logging.set_verbosity_error()
      model = AutoModelForSequenceClassification.from_pretrained(
          transformer_model.model,
          from_tf=False,
          config=config,
          cache_dir=cache_dir,
          force_download=from_pretrained_options.force_download,
          local_files_only=from_pretrained_options.local_files_only,
      )
      transformers_logging.set_verbosity(previous_verbosity)
  
      return config, tokenizer, model
  
file_path: small-text/small_text/integrations/transformers/utils/classification.py
imports: import os
  from typing import List
  from transformers import logging
  from transformers import AutoConfig, AutoModelForSequenceClassification, AutoTokenizer, PreTrainedModel
  from small_text.integrations.transformers.classifiers.base import ModelLoadingStrategy, PretrainedModelLoadingArguments
label_desc: Use image node_id 2 for calling a global function with example usage: _initialize_transformer_components(transformer_model, num_classes, cache_dir) and returns: config,  tokenizer,  model