code: def build_using_auto(
      config_kwargs: Union[Dict, utils.AttrDict],
      tokenizer_kwargs: Union[Dict, utils.AttrDict],
      model_mode: str,
      model_kwargs: Union[Dict, utils.AttrDict],
      use_pretrained_weights: bool = True,
  ) -> Tuple[
      transformers.PretrainedConfig,  # This is how it's named in transformers
      transformers.PreTrainedTokenizer,
      transformers.PreTrainedModel,
  ]:
      """
      Build the config, tokenizer, and model using tranformer's
      Auto classes.
  
      Args:
          config_kwargs: arguments for transformers configuration classes
          tokenizer_kwargs: arguments for transformers tokenizer classes
          model_mode: one of (pretraining, causal-lm, masked-lm, seq2seq-lm, sequence-classification,
              multiple-choice, next-sentence, token-classification, question-answering)
          model_kwargs: arguments for transformers model classes
  
      Returns:
          transformer config, tokenizer, and model
      """
      config = transformers.AutoConfig.from_pretrained(**config_kwargs)
      tokenizer = transformers.AutoTokenizer.from_pretrained(
          **tokenizer_kwargs
      )
      model_builder = MODEL_MODES[model_mode]
      if isinstance(model_kwargs, hf_parse.ModelKwargs):
          model_kwargs = dataclasses.asdict(model_kwargs)
      if use_pretrained_weights:
          model_kwargs["config"] = config
          model = model_builder.from_pretrained(**model_kwargs)
      else:
          model = model_builder.from_config(config)
      return config, tokenizer, model
  
file_path: determined/model_hub/model_hub/huggingface/_trial.py
imports: import dataclasses
  import logging
  from typing import Any, Dict, List, Optional, Tuple, Union, cast
  import datasets
  import torch
  import transformers
  import transformers.optimization
  import determined.pytorch
  from model_hub import utils
  from model_hub.huggingface import _config_parser
label_desc: Use image node_id 1 for calling a global function with example usage: build_using_auto(config_kwargs, tokenizer_kwargs, model_mode, model_kwargs, use_pretrained_weights) and returns: config,  tokenizer,  model