class_docstr: Wrapper class for timm models to be used as backbones. This enables using the timm models interchangeably with the
  other models in the library keeping the same API.
class_docstr_tok: ["Wrapper","class","for","timm","models","to","be","used","as","backbones",".","This","enables","using","the","timm","models","interchangeably","with","the","other","models","in","the","library","keeping","the","same","API","."]
code: def from_pretrained(
      cls, pretrained_model_name_or_path, *model_args, **kwargs
  ):
      requires_backends(cls, ["vision", "timm"])
      from ...models.timm_backbone import TimmBackboneConfig
  
      config = kwargs.pop("config", TimmBackboneConfig())
  
      use_timm = kwargs.pop("use_timm_backbone", True)
      if not use_timm:
          raise ValueError(
              "use_timm_backbone must be True for timm backbones"
          )
  
      num_channels = kwargs.pop("num_channels", config.num_channels)
      features_only = kwargs.pop("features_only", config.features_only)
      use_pretrained_backbone = kwargs.pop(
          "use_pretrained_backbone", config.use_pretrained_backbone
      )
      out_indices = kwargs.pop("out_indices", config.out_indices)
      config = TimmBackboneConfig(
          backbone=pretrained_model_name_or_path,
          num_channels=num_channels,
          features_only=features_only,
          use_pretrained_backbone=use_pretrained_backbone,
          out_indices=out_indices,
      )
      return super()._from_config(config, **kwargs)
  
file_path: transformers/src/transformers/models/timm_backbone/modeling_timm_backbone.py
imports: from typing import Optional, Tuple, Union
  import torch
  from ...modeling_outputs import BackboneOutput
  from ...modeling_utils import PreTrainedModel
  from ...utils import is_timm_available, is_torch_available, requires_backends
  from ...utils.backbone_utils import BackboneMixin
  from .configuration_timm_backbone import TimmBackboneConfig
label_desc: Use image node_id 2 for calling the TimmBackbone obj's underlying member method code with example usage: obj.from_pretrained(cls, pretrained_model_name_or_path) and returns: super