code: def create_model(
      timm_backbone=None,
      pretrained=False,
      checkpoint_path=None,
      device=None,
      **kwargs,
  ):
      if device is None:
          device = "cuda" if torch.cuda.is_available() else "cpu"
      if timm_backbone:
          import timm  # pylint: disable=C0415
  
          backbone = timm.create_model(
              timm_backbone, features_only=True, pretrained=False
          )
          kwargs.update(backbone=backbone)
      model = ISCNet(**kwargs).to(device)
      if pretrained:
          assert (
              checkpoint_path
          ), "Checkpoint path is mandatory for pretrained model."
          state_dict = torch.load(checkpoint_path, map_location=device)
          if "state_dict" in state_dict:
              state_dict = state_dict["state_dict"]
  
          for k in list(state_dict.keys()):
              if k.startswith("module."):
                  state_dict[k[len("module.") :]] = state_dict[k]
                  del state_dict[k]
          model.load_state_dict(state_dict, strict=False)
      model.eval()
      return model
  
imports: import torch.cuda
  from torch import nn
label_desc: Use image node_id 1 for calling a global function with example usage: create_model(timm_backbone, pretrained, checkpoint_path, device) and returns: model