code: def create_model(
      model_name: str = "svt_vitb_k400",
      pretrained: bool = False,
      checkpoint_path: str = None,
      device: str = None,
      **kwargs,
  ):
      if device is None:
          device = "cuda" if torch.cuda.is_available() else "cpu"
  
      if model_name is None:
          if pretrained:
              raise AssertionError(
                  "Fail to load pretrained model: no model name is specified."
              )
          model = TimeSformer(**kwargs)
      else:
          configs = get_configs(model_name)
          configs.update(**kwargs)
          model = TimeSformer(
              img_size=configs["img_size"],
              patch_size=configs["patch_size"],
              in_c=configs["in_c"],
              num_classes=configs["num_classes"],
              embed_dim=configs["embed_dim"],
              depth=configs["depth"],
              num_heads=configs["num_heads"],
              mlp_ratio=configs["mlp_ratio"],
              qkv_bias=configs["qkv_bias"],
              qk_scale=configs["qk_scale"],
              drop_ratio=configs["drop_ratio"],
              attn_drop_ratio=configs["attn_drop_ratio"],
              drop_path_ratio=configs["drop_path_ratio"],
              norm_layer=configs["norm_layer"],
              num_frames=configs["num_frames"],
              attention_type=configs["attention_type"],
              dropout=configs["dropout"],
          )
  
      if pretrained:
          if checkpoint_path is None:
              raise AssertionError(
                  "Fail to load pretrained weights: no pretrained weights is specified."
              )
          state_dict = torch.load(checkpoint_path, map_location=device)
          state_dict = map_state_dict(state_dict)
          model.load_state_dict(state_dict)
      model.to(device)
      model.eval()
      return model
  
imports: import torch
  from towhee.models.timesformer import TimeSformer
  from towhee.models.timesformer.timesformer_utils import map_state_dict
  from towhee.models.svt.svt_utils import get_configs
label_desc: Use image node_id 1 for calling a global function with example usage: create_model(model_name, pretrained, checkpoint_path, device) and returns: model