class_docstr: Trainer Class is used to manage the training and evaluation processes of text generation system models.
  AbstractTrainer is an abstract class in which the fit() and evaluate() method should be implemented according
  to different training and evaluation strategies.
class_docstr_tok: ["Trainer","Class","is","used","to","manage","the","training","and","evaluation","processes","of","text","generation","system","models",".","AbstractTrainer","is","an","abstract","class","in","which","the","fit","(",")","and","evaluate","(",")","method","should","be","implemented","according","to","different","training","and","evaluation","strategies","."]
code: def __init__(self, config: Config, model: AbstractModel):
      self.config = config
      self.model = model
      self.logger = get_logger(__name__)
  
imports: import collections
  import os
  from accelerate.logging import get_logger
  from typing import Optional, Union, List, Dict
  import math
  import torch
  import torch.optim
  import transformers
  from accelerate import Accelerator
  from accelerate.utils import set_seed
  from torch.utils.data import DataLoader
  from tqdm import tqdm
  from textbox import Config
  from textbox.utils.dashboard import get_dashboard, Timestamp, EpochTracker
  from .scheduler import AbstractScheduler, InverseSquareRootScheduler, CosineScheduler, LinearScheduler, ConstantScheduler
  from torch.utils.data import DataLoader
  from ..evaluator import BaseEvaluator
  from ..model.abstract_model import AbstractModel
  from ..utils import serialized_save, init_seed
  from ..utils.enum_type import PLM_MODELS, RNN_MODELS
label_desc: Use image node_id 1 to create a new AbstractTrainer object  with example: obj = AbstractTrainer(config, model)