def run(self, args: Namespace | None = None) -> None:
        """Run the pipeline.

        Args:
            args (Namespace): Arguments to run the pipeline. These are the args returned by ArgumentParser.
        """
        args = self._get_args(args)
        runners = self._setup_runners(args)
        redirect_logs(log_file)
        previous_results: PREV_STAGE_RESULT = None

        for runner in runners:
            try:
                _args = args.get(runner.generator.job_class.name, None)
                previous_results = runner.run(_args, previous_results)
            except Exception:  # noqa: PERF203 catch all exception and allow try-catch in loop
                logger.exception("An error occurred when running the runner.")
                print(
                    f"There were some errors when running {runner.generator.job_class.name} with"
                    f" {runner.__class__.__name__}."
                    f" Please check {log_file} for more details.",
                )
Run the pipeline.

        Args:
            args (Namespace): Arguments to run the pipeline. These are the args returned by ArgumentParser.
        
src/anomalib/pipelines/components/base/pipeline.py