HHousen / lecture2notes

Method used has been deprecated PYL-W1505
Bug risk
Major
8 months ago4 years old
343        else:
344            # different warning message depending on the problem (or both messages)
345            if num_channels != 1:
346                logger.warn(347                    "Resampling to one channel since {} channels were detected".format(
348                        num_channels
349                    )
349                    )
350                )
351            if sample_rate != desired_sample_rate:
352                logger.warn(353                    "Original sample rate ({}) is different than {}hz. Resampling might produce erratic speech recognition.".format(
354                        sample_rate, desired_sample_rate
355                    )
343        else:
344            # different warning message depending on the problem (or both messages)
345            if num_channels != 1:
346                logger.warn(347                    "Resampling to one channel since {} channels were detected".format(
348                        num_channels
349                    )
349                    )
350                )
351            if sample_rate != desired_sample_rate:
352                logger.warn(353                    "Original sample rate ({}) is different than {}hz. Resampling might produce erratic speech recognition.".format(
354                        sample_rate, desired_sample_rate
355                    )
Using deprecated method warn()
635        elif self.params.combination_algo == "keyword_based":
636            summarized_combined = keyword_based_ext(ocr_results_flat, self.transcript)
637        else:  # if no combination algorithm was specified, which should never happen since argparse checks
638            logger.warn("No combination algorithm selected. Defaulting to `concat`.")639            summarized_combined = ocr_results_flat + self.transcript
640
641        # Modifications