def decode_target(self, hypos):
        """Method to decode target string from tokens"""
        hypo_str = self.tgt_dict.string(
            hypos[0][0]["tokens"].int().cpu(),
            self.remove_bpe,
            get_symbols_to_strip_from_output(self.generator),
        )
        if self.bpe is not None:
            hypo_str = self.bpe.decode(hypo_str)
        if self.tokenizer is not None:
            hypo_str = self.tokenizer.decode(hypo_str)
        return hypo_str
Method to decode target string from tokens
structured_prompting/fairseq-version/fairseq/examples/speech_to_speech/benchmarking/core.py