def s2s_dataset_from_iterable_sum_ds(
        self, sum_ds, train_mode, cached_features_file=None, local_rank=-1, top_n=-1,
    ):
        """
        Converts IterableSummarizationDataset to S2SAbsSumDataset.

        Args:
            sum_ds (IterableSummarizationDataset): Input dataset.
            train_mode (bool): Whether the input data is for training or testing.
            cached_features_file (str, optional): Path of the cached features file.
                If provided and the file already exists, it is loaded and used.
                If provided and the file doesn't exist, processed features are
                saved to this file.
                If not provided, processed features are saved to cache_dir.
                Defaults to None.
            local_rank (int, optional): Local rank of the device in distributed
                training. Defaults to -1, which means non-distributed training.
            top_n (int, optional): The number which specifies how many examples in the
                beginning of the input dataset that will be used to create the dataset.
                Defaults to -1, which means the whole dataset should be processsed.

        Returns:
            S2SAbsSumDataset
        """

        examples = []
        if train_mode:
            for source, target in zip(sum_ds, sum_ds.get_target()):
                examples.append({"src": source, "tgt": target})
        else:
            for source in sum_ds:
                examples.append({"src": source})

        s2s_dataset = S2SAbsSumProcessor.create_s2s_dataset(
            examples=examples,
            train_mode=train_mode,
            tokenizer=self.tokenizer,
            output_dir=self.cache_dir,
            local_rank=local_rank,
            cached_features_file=cached_features_file,
            top_n=top_n,
        )

        return s2s_dataset

        Converts IterableSummarizationDataset to S2SAbsSumDataset.

        Args:
            sum_ds (IterableSummarizationDataset): Input dataset.
            train_mode (bool): Whether the input data is for training or testing.
            cached_features_file (str, optional): Path of the cached features file.
                If provided and the file already exists, it is loaded and used.
                If provided and the file doesn't exist, processed features are
                saved to this file.
                If not provided, processed features are saved to cache_dir.
                Defaults to None.
            local_rank (int, optional): Local rank of the device in distributed
                training. Defaults to -1, which means non-distributed training.
            top_n (int, optional): The number which specifies how many examples in the
                beginning of the input dataset that will be used to create the dataset.
                Defaults to -1, which means the whole dataset should be processsed.

        Returns:
            S2SAbsSumDataset
        
utils_nlp/models/transformers/abstractive_summarization_seq2seq.py