code: def resize_temporal_embedding(state_dict, key, num_frames):
      logging.info(
          f"Resizing temporal position embedding from {state_dict[key].size(1)} to {num_frames}"
      )
  
      time_embed = state_dict[key].transpose(1, 2)
      new_time_embed = F.interpolate(
          time_embed, size=(num_frames), mode="nearest"
      )
  
      return new_time_embed.transpose(1, 2)
  
file_path: lavis/lavis/models/alpro_models/__init__.py
imports: import logging
  import os
  import torch
  import torch.nn.functional
  from lavis.common.dist_utils import download_cached_file
  from lavis.common.utils import is_url
  from lavis.models.base_model import BaseModel
  from transformers import BertTokenizer
label_desc: Use image node_id 2 for calling a global function with example usage: resize_temporal_embedding(state_dict, key, num_frames) and returns: new_time_embed