def METHOD_NAME(self, input: Dict[str, Any]) -> Dict[str, Any]:
    text_embeds, vid_embeds_pooled, vid_ids, texts = self.database
    with torch.no_grad():
        if input['mode'] == 't2v':
            query_feats = self.model.get_text_features(input['input_data'])
            score = query_feats @ vid_embeds_pooled.T
            retrieval_idxs = torch.topk(
                score, k=self.cfg.hyperparam.topk,
                dim=-1)[1].cpu().numpy()
            res = np.array(vid_ids)[retrieval_idxs]
        elif input['mode'] == 'v2t':
            query_feats = self.model.get_video_features(
                input['input_data'])
            score = query_feats @ text_embeds.T
            retrieval_idxs = torch.topk(
                score, k=self.cfg.hyperparam.topk,
                dim=-1)[1].cpu().numpy()
            res = np.array(texts)[retrieval_idxs]
        results = {'output_data': res, 'mode': input['mode']}
        return results