code: def load_pretrained(cls, *args, **kw):
      """Load a transformers model in TF2, with fallback to PyTorch weights."""
      try:
          return cls.from_pretrained(*args, **kw)
      except OSError as e:
          logging.warning("Caught OSError loading model: %s", e)
          logging.warning(
              "Re-trying to convert from PyTorch checkpoint (from_pt=True)"
          )
          return cls.from_pretrained(*args, from_pt=True, **kw)
  
imports: from typing import Optional
  from absl import logging
  import transformers
label_desc: Use image node_id 1 for calling a global function with example usage: load_pretrained(cls) and returns: cls, cls