code: def from_pretrained(
      cls, pretrain_dir_or_url, force_download=False, **kwargs
  ):
      if pretrain_dir_or_url in cls.resource_map:
          url = cls.resource_map[pretrain_dir_or_url]
          log.info("get pretrain dir from %s" % url)
          pretrain_dir = _fetch_from_remote(url, force_download)
      else:
          log.info(
              "pretrain dir %s not in %s, read from local"
              % (pretrain_dir_or_url, repr(cls.resource_map))
          )
          pretrain_dir = pretrain_dir_or_url
  
      if not os.path.exists(pretrain_dir):
          raise ValueError("pretrain dir not found: %s" % pretrain_dir)
      param_path = os.path.join(pretrain_dir, "params")
      state_dict_path = os.path.join(pretrain_dir, "saved_weights")
      config_path = os.path.join(pretrain_dir, "ernie_config.json")
  
      if not os.path.exists(config_path):
          raise ValueError("config path not found: %s" % config_path)
      name_prefix = kwargs.pop("name", None)
      cfg_dict = dict(json.loads(open(config_path).read()), **kwargs)
      # model = cls(cfg_dict, name=name_prefix)
      log.info("loading pretrained model from %s" % pretrain_dir)
      return cfg_dict, param_path
  
file_path: PGL/legacy/examples/erniesage/models/pretrain_model_loader.py
imports: import os
  import json
  import numpy
  import pgl
  import paddle.fluid
  import paddle.fluid.layers
  from pgl.utils.logger import log
  from ernie.file_utils import _fetch_from_remote
  from models.encoder import Encoder
  from models.loss import Loss
label_desc: Use image node_id 1 for calling the PretrainedModelLoader obj's underlying member method code with example usage: obj.from_pretrained(cls, pretrain_dir_or_url, force_download) and returns: cfg_dict,  param_path