code: def from_config(config: Config):
      check_vit_in_transformers()
  
      config_with_defaults = OmegaConf.create(
          {**asdict(ViTModel.Config()), **config}
      )
      random_init = config_with_defaults.get("random_init", False)
  
      hf_config = retry_n(
          NUM_RETRIES,
          vit.ViTConfig.from_pretrained,
          config_with_defaults.pretrained_model_name,
          **OmegaConf.to_container(config_with_defaults),
      )
      hf_config.update(config)
  
      if not random_init:
          module = retry_n(
              NUM_RETRIES,
              ViTModel.from_pretrained,
              config.pretrained_model_name,
              config=hf_config,
          )
      else:
          module = ViTModel(hf_config)
  
      return module, hf_config
  
imports: from collections import namedtuple
  from dataclasses import asdict, dataclass
  import torch
  from mmf.utils.general import retry_n
  from omegaconf import OmegaConf
  from packaging import version
  from torch import nn
label_desc: Use image node_id 5 for calling the ViTModel obj's underlying member method code with example usage: obj.from_config(config) and returns: module,  hf_config