code: def __init__(
      self,
      algo: str = "fedavg",
      model_conf: Optional[Dict] = None,
      dataset_conf: Optional[Dict] = None,
      optimizer_conf: Optional[Dict] = None,
      training_args_conf: Optional[Dict] = None,
      fed_args_conf: Optional[Dict] = None,
      loss_conf: Optional[Dict] = None,
      data_collator_conf: Optional[Dict] = None,
      tokenizer_conf: Optional[Dict] = None,
      task_type: Literal[
          "binary", "multi", "regression", "others"
      ] = "binary",
      threshold: float = 0.5,
      local_mode: bool = False,
  ) -> None:
      super().__init__()
      self.algo = algo
      self.model_conf = model_conf
      self.dataset_conf = dataset_conf
      self.optimizer_conf = optimizer_conf
      self.training_args_conf = training_args_conf
      self.fed_args_conf = fed_args_conf
      self.loss_conf = loss_conf
      self.data_collator_conf = data_collator_conf
      self.local_mode = local_mode
      self.tokenizer_conf = tokenizer_conf
      self.task_type = task_type
      self.threshold = threshold
  
      # check param
      if self.algo not in SUPPORTED_ALGO:
          raise ValueError("algo should be one of [fedavg]")
      if self.task_type not in [
          "binary",
          "multi",
          "regression",
          "others",
      ]:
          raise ValueError(
              "task_type should be one of [binary, multi, regression, others]"
          )
      assert (
          self.threshold >= 0 and self.threshold <= 1
      ), "threshold should be in [0, 1]"
      assert isinstance(self.local_mode, bool), "local should be bool"
  
      # setup var
      self.trainer = None
      self.training_args = None
  
imports: import torch
  import os
  from fate.components.components.nn.nn_runner import NNRunner, load_model_dict_from_path, dir_warning, loader_load_from_conf, run_dataset_func
  from fate.ml.nn.homo.fedavg import FedAVG, FedAVGArguments, FedAVGClient, FedAVGServer
  from typing import Dict
  from fate.components.components.nn.loader import Loader
  import torch.nn
  import torch.optim
  from torch.optim.lr_scheduler import _LRScheduler
  from fate.ml.nn.trainer.trainer_base import FedArguments, TrainingArguments, HomoTrainerClient, HomoTrainerServer
  from typing import Union, Type, Callable, Optional
  from transformers.trainer_utils import get_last_checkpoint
  from typing import Literal
  import logging
  from fate.components.components.utils import consts
  from fate.ml.nn.dataset.table import TableDataset, Dataset
  from fate.arch.dataframe import DataFrame
label_desc: Use image node_id 1 to create a new DefaultRunner object from inherited base classes: NNRunner with example: obj = DefaultRunner(algo, model_conf, dataset_conf, optimizer_conf, training_args_conf, fed_args_conf, loss_conf, data_collator_conf, tokenizer_conf, task_type, threshold, local_mode)