code: def main(cfg, model_path):
      dataset = KinshipDataset(
          root_dir="examples/pytorch/kg_completion/data/{}".format(
              cfg["dataset"]
          ),
          topology_subdir="kgc",
      )
  
      test_dataloader = DataLoader(
          dataset.test,
          batch_size=cfg["batch_size"],
          shuffle=False,
          num_workers=0,
          # num_workers=args.loader_threads,
          collate_fn=dataset.collate_fn,
      )
  
      num_entities = len(dataset.vocab_model.in_word_vocab)
      num_relations = len(dataset.vocab_model.out_word_vocab)
  
      graph_path = (
          "examples/pytorch/kg_completion/data/{}/processed/kgc/"
          "KG_graph.pt".format(cfg["dataset"])
      )
      KG_graph = torch.load(graph_path)
  
      if cfg["cuda"] is True:
          KG_graph = KG_graph.to("cuda")
      else:
          KG_graph = KG_graph.to("cpu")
  
      model = KGC(cfg, num_entities, num_relations)
  
      if cfg["cuda"] is True:
          model.to("cuda")
  
      model_params = torch.load(model_path)
      print(model)
      total_param_size = []
      params = [
          (key, value.size(), value.numel())
          for key, value in model_params.items()
      ]
      for key, size, count in params:
          total_param_size.append(count)
          print(key, size, count)
      print(np.array(total_param_size).sum())
      model.load_state_dict(model_params)
      model.eval()
      ranking_and_hits_this(
          cfg,
          model,
          test_dataloader,
          dataset.vocab_model,
          "test_evaluation",
          kg_graph=KG_graph,
      )
  
imports: import argparse
  import os
  import numpy
  import torch
  import torch.backends.cudnn
  import torch.nn
  from torch.utils.data import DataLoader
  from graph4nlp.pytorch.datasets.kinship import KinshipDataset
  from graph4nlp.pytorch.modules.utils.config_utils import get_yaml_config
  from .model import Complex, ConvE, Distmult, GCNComplex, GCNDistMult, GGNNDistMult
label_desc: Use image node_id 2 for calling a global function with example usage: main(cfg, model_path) without return types