code: def test_chemberta_load_from_pretrained(
      tmpdir, smiles_regression_dataset
  ):
      pretrain_model_dir = os.path.join(tmpdir, "pretrain")
      finetune_model_dir = os.path.join(tmpdir, "finetune")
      tokenizer_path = "seyonec/PubChem10M_SMILES_BPE_60k"
      pretrain_model = Chemberta(
          task="mlm",
          tokenizer_path=tokenizer_path,
          model_dir=pretrain_model_dir,
      )
      pretrain_model.save_checkpoint()
  
      finetune_model = Chemberta(
          task="regression",
          tokenizer_path=tokenizer_path,
          model_dir=finetune_model_dir,
      )
      finetune_model.load_from_pretrained(pretrain_model_dir)
  
      # check weights match
      pretrain_model_state_dict = pretrain_model.model.state_dict()
      finetune_model_state_dict = finetune_model.model.state_dict()
  
      pretrain_base_model_keys = [
          key
          for key in pretrain_model_state_dict.keys()
          if "roberta" in key
      ]
      matches = [
          torch.allclose(
              pretrain_model_state_dict[key],
              finetune_model_state_dict[key],
          )
          for key in pretrain_base_model_keys
      ]
  
      assert all(matches)
  
file_path: deepchem/deepchem/models/torch_models/tests/test_chemberta.py
imports: import os
  import deepchem
  import numpy
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_chemberta_load_from_pretrained(tmpdir, smiles_regression_dataset) without return types