code: def model_creator(config):
      if config.get("num_channels") and (
          config.get("nhid") and config.get("levels")
      ):
          warnings.warn(
              f"WARNING: You set both num_channels and (nhid, levels) for TCN. "
              f"Only num_channels={config['num_channels']} will be effective."
          )
      if config.get("num_channels"):
          num_channels = config["num_channels"]
      else:
          n_hid = config["nhid"] if config.get("nhid") else 30
          levels = config["levels"] if config.get("levels") else 8
          num_channels = [n_hid] * (levels - 1)
  
      model = TemporalConvNet(
          past_seq_len=config["past_seq_len"],
          input_feature_num=config["input_feature_num"],
          future_seq_len=config["future_seq_len"],
          output_feature_num=config["output_feature_num"],
          num_channels=num_channels.copy(),
          dummy_encoder=config.get("dummy_encoder", False),
          kernel_size=config.get("kernel_size", 7),
          dropout=config.get("dropout", 0.2),
          repo_initialization=config.get("repo_initialization", True),
          seed=config.get("seed", None),
      )
  
      if config.get("normalization", False):
          model = NormalizeTSModel(model, config["output_feature_num"])
      decomposition_kernel_size = config.get(
          "decomposition_kernel_size", 0
      )
      if decomposition_kernel_size > 1:
          model_copy = TemporalConvNet(
              past_seq_len=config["past_seq_len"],
              input_feature_num=config["input_feature_num"],
              future_seq_len=config["future_seq_len"],
              output_feature_num=config["output_feature_num"],
              num_channels=num_channels.copy(),
              dummy_encoder=config.get("dummy_encoder", False),
              kernel_size=config.get("kernel_size", 7),
              dropout=config.get("dropout", 0.2),
              repo_initialization=config.get(
                  "repo_initialization", True
              ),
              seed=config.get("seed", None),
          )
          if config.get("normalization", False):
              model_copy = NormalizeTSModel(
                  model_copy, config["output_feature_num"]
              )
          model = DecompositionTSModel(
              (model, model_copy), decomposition_kernel_size
          )
  
      return model
  
imports: import warnings
  import torch
  import torch.nn
  from .utils import PYTORCH_REGRESSION_LOSS_MAP
  from pytorch_lightning import seed_everything
  from bigdl.chronos.pytorch.model_wrapper.normalization import NormalizeTSModel
  from bigdl.chronos.pytorch.model_wrapper.decomposition import DecompositionTSModel
label_desc: Use image node_id 1 for calling a global function with example usage: model_creator(config) and returns: model