    def evaluate(self, model: nn.Module, logs: dict) -> dict:
        """
        Evaluate the model.

        Args:
            model (`nn.Module`):
                Pytorch model.
            logs (`dict`):
                Logs dict.

        Returns:
            (`dict`)
                The new logs dict with evaluate values.
        """
        model.eval()
        self.callbacks.on_eval_begin(logs)
        self.metric.reset()
        eval_dataloader = self.get_eval_dataloader()
        if eval_dataloader is None:
            trainer_log.warning("eval_dataloader is None!")
            return logs
        for _, inputs in enumerate(eval_dataloader):
            self.callbacks.on_eval_batch_begin(inputs, logs)
            inputs = send_to_device(inputs, self.configs.device)
            step_logs = self.evaluate_step(model, inputs)
            logs.update(step_logs)
            self.callbacks.on_eval_batch_end(tuple(inputs), logs)
            logs["eval_global_step"] += 1
        self.callbacks.on_eval_end(logs)
        return logs
Evaluate the model.

Args:
model (`nn.Module`):
Pytorch model.
logs (`dict`):
Logs dict.

Returns:
(`dict`)
The new logs dict with evaluate values.
towhee/trainer/trainer.py