    def predict_loop(self, model, eval_dataloader, output_file="didemo.npy"):
        """
        TODO: two solutions here.
        """
        import itertools
        # 21 chunks.
        self.possible_segments = [(0,0), (1,1), (2,2), (3,3), (4,4), (5,5)]
        for i in itertools.combinations(range(6), 2):
            self.possible_segments.append(i)
        # pick segments from a video.

        """on-the-fly prediction on a single gpu."""
        self.full_scores = []
        model.eval()
        model = model.cuda()
        with torch.no_grad():
            for data in eval_dataloader:
                # TODO special forwarding logic here.
                data = self.to_ctx(data)
                data["output_hidden_states"] = True
                hidden_video = model.forward_video(**data)
                data["output_hidden_states"] = False
                pooled_text = model.forward_text(**data)
                outputs = {
                    "hidden_video": hidden_video,
                    "pooled_text": pooled_text
                }
                outputs.update(data)
                self(outputs)
        return self.finalize(output_file)
TODO: two solutions here.
examples/MMPT/mmpt/evaluators/predictor.py