class_docstr: NoneTrainer is a trainer that does not train a model, only runs evaluation.
class_docstr_tok: ["NoneTrainer","is","a","trainer","that","does","not","train","a","model",",","only","runs","evaluation","."]
docstr: :param config: `ludwig.schema.trainer.NoneTrainerConfig` instance that specifies training hyperparameters
  (default: `ludwig.schema.trainer.NoneTrainerConfig()`).
  :param model: Underlying Ludwig model
  :type model: `ludwig.models.llm.LLM`
  :param resume: Resume training a model that was being trained. (default: False).
  :type resume: Boolean
  :param skip_save_model: Disables saving model weights and hyperparameters each time the model improves. By
          default Ludwig saves model weights after each round of evaluation the validation metric (improves, but
          if the model is really big that can be time consuming. If you do not want to keep the weights and just
          find out what performance a model can get with a set of hyperparameters, use this parameter to skip it,
          but the model will not be loadable later on. (default: False).
  :type skip_save_model: Boolean
  :param skip_save_progress: Disables saving progress each round of evaluation. By default Ludwig saves weights
          and stats after each round of evaluation for enabling resuming of training, but if the model is really
          big that can be time consuming and will uses twice as much space, use this parameter to skip it, but
          training cannot be resumed later on. (default: False).
  :type skip_save_progress: Boolean
  :param skip_save_log: Disables saving TensorBoard logs. By default Ludwig saves logs for the TensorBoard, but if
          it is not needed turning it off can slightly increase the overall speed. (default: False).
  :type skip_save_log: Boolean
  :param callbacks: List of `ludwig.callbacks.Callback` objects that provide hooks into the Ludwig pipeline.
          (default: None).
  :type callbacks: list
  :param report_tqdm_to_ray: Enables using the ray based tqdm Callback for progress bar reporting
  :param random_seed: Default initialization for the random seeds (default: 42).
  :type random_seed: Float
  :param distributed: Distributed strategy (default: None).
  :type distributed: `DistributedStrategy`
  :param device: Device to load the model on from a saved checkpoint (default: None).
  :type device: str
code: def __init__(
      self,
      config: NoneTrainerConfig,
      model: LLM,
      resume: float = False,
      skip_save_model: bool = False,
      skip_save_progress: bool = False,
      skip_save_log: bool = False,
      callbacks: List = None,
      report_tqdm_to_ray=False,
      random_seed: float = default_random_seed,
      distributed: Optional[DistributedStrategy] = None,
      device: Optional[str] = None,
      **kwargs,
  ):
      """
      :param config: `ludwig.schema.trainer.NoneTrainerConfig` instance that specifies training hyperparameters
      (default: `ludwig.schema.trainer.NoneTrainerConfig()`).
      :param model: Underlying Ludwig model
      :type model: `ludwig.models.llm.LLM`
      :param resume: Resume training a model that was being trained. (default: False).
      :type resume: Boolean
      :param skip_save_model: Disables saving model weights and hyperparameters each time the model improves. By
              default Ludwig saves model weights after each round of evaluation the validation metric (improves, but
              if the model is really big that can be time consuming. If you do not want to keep the weights and just
              find out what performance a model can get with a set of hyperparameters, use this parameter to skip it,
              but the model will not be loadable later on. (default: False).
      :type skip_save_model: Boolean
      :param skip_save_progress: Disables saving progress each round of evaluation. By default Ludwig saves weights
              and stats after each round of evaluation for enabling resuming of training, but if the model is really
              big that can be time consuming and will uses twice as much space, use this parameter to skip it, but
              training cannot be resumed later on. (default: False).
      :type skip_save_progress: Boolean
      :param skip_save_log: Disables saving TensorBoard logs. By default Ludwig saves logs for the TensorBoard, but if
              it is not needed turning it off can slightly increase the overall speed. (default: False).
      :type skip_save_log: Boolean
      :param callbacks: List of `ludwig.callbacks.Callback` objects that provide hooks into the Ludwig pipeline.
              (default: None).
      :type callbacks: list
      :param report_tqdm_to_ray: Enables using the ray based tqdm Callback for progress bar reporting
      :param random_seed: Default initialization for the random seeds (default: 42).
      :type random_seed: Float
      :param distributed: Distributed strategy (default: None).
      :type distributed: `DistributedStrategy`
      :param device: Device to load the model on from a saved checkpoint (default: None).
      :type device: str
      """
  
      super().__init__()
      self.config = config
      self.distributed = (
          distributed if distributed is not None else LocalStrategy()
      )
      self.skip_save_log = skip_save_log
      self.resume = resume
      self.skip_save_model = skip_save_model
      self.skip_save_progress = skip_save_progress
      self.random_seed = random_seed
      self.callbacks = callbacks or []
      self.report_tqdm_to_ray = report_tqdm_to_ray
  
      self.device = device if device is not None else get_torch_device()
      self.model = model.to_device(self.device)
      self.model.metrics_to_device(self.device)
  
      # Since we are only running evaluation without training, set the model to evaluation mode.
      self.model.eval()
  
      self.batch_size = self.config.batch_size
      self.eval_batch_size = self.config.eval_batch_size
      self.base_learning_rate = self.config.base_learning_rate
      self.should_shuffle = self.config.should_shuffle
      self.epochs = self.config.epochs
      self.train_steps = self.config.train_steps
      self.steps_per_checkpoint = self.config.steps_per_checkpoint
      self.checkpoints_per_epoch = self.config.checkpoints_per_epoch
      self.early_stop = self.config.early_stop
      self.evaluate_training_set = self.config.evaluate_training_set
      self.skip_all_evaluation = self.config.skip_all_evaluation
  
imports: import logging
  import os
  import time
  from typing import Callable, Dict, List, Optional, Union
  from torch.utils.tensorboard import SummaryWriter
  from ludwig.constants import MINIMUM_BATCH_SIZE, TEST, TRAINING, VALIDATION
  from ludwig.data.dataset.base import Dataset
  from ludwig.distributed.base import DistributedStrategy, LocalStrategy
  from ludwig.features.feature_utils import LudwigFeatureDict
  from ludwig.models.llm import LLM
  from ludwig.models.predictor import LlmFineTunePredictor, LlmPredictor
  from ludwig.modules.metric_modules import get_initial_validation_value
  from ludwig.schema.trainer import BaseTrainerConfig, FineTuneTrainerConfig, NoneTrainerConfig
  from ludwig.trainers.base import BaseTrainer
  from ludwig.trainers.registry import register_llm_ray_trainer, register_llm_trainer
  from ludwig.trainers.trainer import Trainer
  from ludwig.types import ModelConfigDict
  from ludwig.utils import time_utils
  from ludwig.utils.defaults import default_random_seed
  from ludwig.utils.metric_utils import TrainerMetric
  from ludwig.utils.metrics_printed_table import print_metrics_table
  from ludwig.utils.misc_utils import set_random_seed
  from ludwig.utils.torch_utils import get_torch_device
  from ludwig.utils.trainer_utils import append_metrics, get_new_progress_tracker, ProgressTracker
label_desc: Use image node_id 1 to create a new NoneTrainer object from inherited base classes: BaseTrainer with example: obj = NoneTrainer(config, model, resume, skip_save_model, skip_save_progress, skip_save_log, callbacks, report_tqdm_to_ray, random_seed, distributed, device)