游雁
2024-06-08 9fd3c47fd7ff191e1e07457b6bcffa1823e69b51
funasr/datasets/openai_datasets/datasets.py
@@ -155,11 +155,14 @@
                fbank_beg.append(fbank_beg_i)
            if len(input_ids) > self.max_token_length:
                logging.info(
                    f"input_ids > max_token_length: {len(input_ids)}>{self.max_token_length}, {item}"
                )
                badcase_flag = True
            if badcase_flag:
                continue
            input_ids = torch.tensor(input_ids, dtype=torch.int64)  # [: self.max_token_length]
            attention_mask = torch.tensor([len(input_ids)], dtype=torch.int32)
            attention_mask = torch.tensor([1] * len(input_ids), dtype=torch.int32)
            labels = torch.tensor(labels, dtype=torch.int64)  # [: self.max_token_length]
            fbank = speech[0, :, :]