    def first_pass_decoder_task_index(self):
        """Return the task index of the first-pass text decoder.
        If there are multiple 'is_first_pass_decoder: True' in the config file,
            the last task is used for the first-pass decoder.
        If there is no 'is_first_pass_decoder: True' in the config file,
            the last task whose task_name includes 'target' and decoder_type is not ctc.
        """
        idx = -1
        for i, (k, v) in enumerate(self.config.items()):
            if v.is_first_pass_decoder:
                idx = i
        if idx < 0:
            for i, (k, v) in enumerate(self.config.items()):
                if k.startswith("target") and v.decoder_type == "transformer":
                    idx = i
        return idx
Return the task index of the first-pass text decoder.
If there are multiple 'is_first_pass_decoder: True' in the config file,
the last task is used for the first-pass decoder.
If there is no 'is_first_pass_decoder: True' in the config file,
the last task whose task_name includes 'target' and decoder_type is not ctc.
fairseq/data/audio/data_cfg.py