code: def test_lazy_from_pretrained():
      # test from cached file, unsharded
      model = BertForPreTraining.from_pretrained("prajjwal1/bert-tiny")
      with LazyInitContext():
          deffered_model = BertForPreTraining.from_pretrained(
              "prajjwal1/bert-tiny"
          )
      pretrained_path = pretrained_utils.get_pretrained_path(
          deffered_model
      )
      assert os.path.isfile(pretrained_path)
      for p, lazy_p in zip(
          model.parameters(), deffered_model.parameters()
      ):
          assert p.shape == lazy_p.shape
  
      # test from local file, sharded
      llama_path = os.environ["LLAMA_PATH"]
      model = LlamaForCausalLM.from_pretrained(llama_path)
      with LazyInitContext():
          deffered_model = LlamaForCausalLM.from_pretrained(llama_path)
      pretrained_path = pretrained_utils.get_pretrained_path(
          deffered_model
      )
      assert os.path.isfile(pretrained_path)
      for p, lazy_p in zip(
          model.parameters(), deffered_model.parameters()
      ):
          assert p.shape == lazy_p.shape
  
imports: import os
  from transformers import BertForPreTraining, LlamaForCausalLM
  import colossalai.interface.pretrained
  from colossalai.lazy import LazyInitContext
label_desc: Use image node_id 1 for calling a global function with example usage: test_lazy_from_pretrained() without return types