def evaluate(self, eval_dataset: Optional[Dataset]=None, prediction_loss_only: Optional[bool]=None, context: str=None, do_test_if_needed: bool=True):
    datasets = (eval_dataset or self.eval_datasets)
    logger.info('*** Evaluate on dev ***')
    for (task_name, eval_dataset) in datasets.items():
        logger.info(task_name)
        self.compute_metrics = self.build_compute_metrics_fn(eval_dataset)
        eval_dataloader = self.get_eval_dataloader(eval_dataset)
        eval_result = self._prediction_loop(eval_dataloader, description='Evaluation', task_name=task_name, mode=eval_dataset.mode)
        self._log(eval_result.metrics)
        for (key, value) in eval_result.metrics.items():
            logger.info('  %s = %s', key, value)
    if self.args.tpu_metrics_debug:
        xm.master_print(met.metrics_report())
def evaluate(self, eval_dataset: Optional[Dataset]=None, prediction_loss_only: Optional[bool]=None, context: str=None, do_test_if_needed: bool=True):
    datasets = (eval_dataset or self.eval_datasets)
    logger.info('*** Evaluate on dev ***')
    for (task_name, eval_dataset) in datasets.items():
        logger.info(task_name)
        self.compute_metrics = self.build_compute_metrics_fn(eval_dataset)
        eval_dataloader = self.get_eval_dataloader(eval_dataset)
        eval_result = self._prediction_loop(eval_dataloader, description='Evaluation', task_name=task_name, mode=eval_dataset.mode)
        self._log(eval_result.metrics)
        for (key, value) in eval_result.metrics.items():
            logger.info('  %s = %s', key, value)
    if self.args.tpu_metrics_debug:
        xm.master_print(met.metrics_report())