def METHOD_NAME(self, input: Input, **preprocess_params) -> Dict[str, Any]:
    if isinstance(input, str):
        if '.mp4' in input:
            query = []
            for video_path in [input]:
                video_path = osp.join(self.local_pth, video_path)
                imgs, idxs = load_frames_from_video(
                    video_path, self.cfg.hyperparam.num_frames,
                    self.cfg.hyperparam.video_sample_type)
                imgs = self.img_transform(imgs)
                query.append(imgs)
            query = torch.stack(
                query, dim=0).to(
                    self.device, non_blocking=True)
            mode = 'v2t'
        else:
            query = self.tokenizer(
                input, return_tensors='pt', padding=True, truncation=True)
            if isinstance(query, torch.Tensor):
                query = query.to(self.device, non_blocking=True)
            else:
                query = {
                    key: val.to(self.device, non_blocking=True)
                    for key, val in query.items()
                }
            mode = 't2v'
    else:
        raise TypeError(f'input should be a str,'
                        f'  but got {type(input)}')
    result = {'input_data': query, 'mode': mode}
    return result