def eval_model(self, eval_data, output_dir=None, verbose=True, silent=False, **kwargs):
    '\n        Evaluates the model on eval_data. Saves results to output_dir.\n\n        Args:\n            eval_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`.\n                        - `input_text`: The input text sequence.\n                        - `target_text`: The target text sequence.\n            output_dir: The directory where model files will be saved. If not given, self.args.output_dir will be used.\n            verbose: If verbose, results will be printed to the console on completion of evaluation.\n            silent: If silent, tqdm progress bars will be hidden.\n            **kwargs: Additional metrics that should be used. Pass in the metrics as keyword arguments (name of metric: function to use).\n                        A metric function should take in two parameters. The first parameter will be the true labels, and the second parameter will be the predictions. Both inputs\n                        will be lists of strings. Note that this will slow down evaluation significantly as the predicted sequences need to be generated.\n        Returns:\n            results: Dictionary containing evaluation results.\n        '
    if (not output_dir):
        output_dir = self.args.output_dir
    self._move_model_to_device()
    eval_dataset = self.load_and_cache_examples(eval_data, evaluate=True, verbose=verbose, silent=silent)
    os.makedirs(output_dir, exist_ok=True)
    result = self.evaluate(eval_dataset, output_dir, verbose=verbose, silent=silent, **kwargs)
    self.results.update(result)
    if self.args.evaluate_generated_text:
        to_predict = eval_data['input_text'].tolist()
        preds = self.predict(to_predict)
        result = self.compute_metrics(eval_data['target_text'].tolist(), preds, **kwargs)
        self.results.update(result)
    if verbose:
        logger.info(self.results)
    return self.results
Evaluates the model on eval_data. Saves results to output_dir.

Args:
    eval_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`.
                - `input_text`: The input text sequence.
                - `target_text`: The target text sequence.
    output_dir: The directory where model files will be saved. If not given, self.args.output_dir will be used.
    verbose: If verbose, results will be printed to the console on completion of evaluation.
    silent: If silent, tqdm progress bars will be hidden.
    **kwargs: Additional metrics that should be used. Pass in the metrics as keyword arguments (name of metric: function to use).
                A metric function should take in two parameters. The first parameter will be the true labels, and the second parameter will be the predictions. Both inputs
                will be lists of strings. Note that this will slow down evaluation significantly as the predicted sequences need to be generated.
Returns:
    results: Dictionary containing evaluation results.
def eval_model(self, eval_data, output_dir=None, verbose=True, silent=False, **kwargs):
    '\n        Evaluates the model on eval_data. Saves results to output_dir.\n\n        Args:\n            eval_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`.\n                        - `input_text`: The input text sequence.\n                        - `target_text`: The target text sequence.\n            output_dir: The directory where model files will be saved. If not given, self.args.output_dir will be used.\n            verbose: If verbose, results will be printed to the console on completion of evaluation.\n            silent: If silent, tqdm progress bars will be hidden.\n            **kwargs: Additional metrics that should be used. Pass in the metrics as keyword arguments (name of metric: function to use).\n                        A metric function should take in two parameters. The first parameter will be the true labels, and the second parameter will be the predictions. Both inputs\n                        will be lists of strings. Note that this will slow down evaluation significantly as the predicted sequences need to be generated.\n        Returns:\n            results: Dictionary containing evaluation results.\n        '
    if (not output_dir):
        output_dir = self.args.output_dir
    self._move_model_to_device()
    eval_dataset = self.load_and_cache_examples(eval_data, evaluate=True, verbose=verbose, silent=silent)
    os.makedirs(output_dir, exist_ok=True)
    result = self.evaluate(eval_dataset, output_dir, verbose=verbose, silent=silent, **kwargs)
    self.results.update(result)
    if self.args.evaluate_generated_text:
        to_predict = eval_data['input_text'].tolist()
        preds = self.predict(to_predict)
        result = self.compute_metrics(eval_data['target_text'].tolist(), preds, **kwargs)
        self.results.update(result)
    if verbose:
        logger.info(self.results)
    return self.results