code: def __init__(self, **cli_args):
      self.cmd: str = cli_args.get("cmd")
      self.data_path: str = cli_args.get("data_path")
      self.config_path: str = cli_args.get("yaml_path")
      self.task = cli_args.get("task")
      logger.info(f"Executing command: {self.cmd}")
      logger.info(f"Reading data from: {self.data_path}")
      logger.info(f"Reading yaml configs from: {self.config_path}")
  
      if self.cmd == "train":
          if not self.config_path:
              self.model_type = self.task
          else:
              self.file_ext: str = self.config_path.split(".")[1]
  
              if self.file_ext not in ["yaml", "yml", "json"]:
                  raise Exception(
                      "Configuration file can be a yaml or a json file!"
                  )
  
              self.configs: dict = (
                  read_json(self.config_path)
                  if self.file_ext == "json"
                  else read_yaml(self.config_path)
              )
  
              self.dataset_props: dict = self.configs.get(
                  "dataset", self.defaults.dataset_props
              )
              self.model_props: dict = self.configs.get(
                  "model", self.defaults.model_props
              )
              self.training_args: dict = self.configs.get(
                  "training", self.defaults.training_args
              )
              self.model_args = self.model_props.get("arguments")
              self.model_type = self.task or self.model_props.get(
                  "type"
              )
  
      else:
          self.model_path = cli_args.get(
              "model_path", self.defaults.model_path
          )
          logger.info(
              f"path of the pre-fitted model => {self.model_path}"
          )
          self.prediction_file = cli_args.get(
              "prediction_file", self.defaults.prediction_file
          )
          # set description.json if provided:
          self.description_file = cli_args.get(
              "description_file", self.defaults.description_file
          )
          # load description file to read stored training parameters
          with open(self.description_file) as f:
              dic = json.load(f)
              self.model_type: str = dic.get(
                  "task"
              )  # type of the model
              self.dataset_props: dict = dic.get(
                  "dataset_props"
              )  # dataset props entered while fitting
      getattr(self, self.cmd)()
  
file_path: igel/igel/auto/cnn.py
imports: import json
  import logging
  import os
  import autokeras
  from igel.auto.defaults import Defaults
  from igel.auto.models import Models
  from igel.constants import Constants
  from igel.utils import read_json, read_yaml
  from tensorflow.keras.models import load_model
label_desc: Use image node_id 1 to create a new IgelCNN object  with example: obj = IgelCNN()