code: def save_embedding_config(
      embed: TransformerEmbedding,
      base_path: Path,
      local_path: Path = Path("."),
  ) -> dict:
      """
      Save embeddings for text drift models.
  
      Parameters
      ----------
      embed
          Embedding model.
      base_path
          Base filepath to save to (the location of the `config.toml` file).
      local_path
          A local (relative) filepath to append to base_path.
      """
      # create folder to save model in
      filepath = base_path.joinpath(local_path)
      if not filepath.is_dir():
          logger.warning(
              "Directory {} does not exist and is now created.".format(
                  filepath
              )
          )
          filepath.mkdir(parents=True, exist_ok=True)
  
      # Populate config dict
      cfg_embed: Dict[str, Any] = {}
      cfg_embed.update({"type": embed.emb_type})
      cfg_embed.update({"layers": embed.hs_emb.keywords["layers"]})
      cfg_embed.update({"src": local_path})
      cfg_embed.update({"flavour": Framework.TENSORFLOW.value})
  
      # Save embedding model
      logger.info("Saving embedding model to {}.".format(filepath))
      embed.model.save_pretrained(filepath)
  
      return cfg_embed
  
imports: import logging
  import os
  from functools import partial
  from pathlib import Path
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import dill
  import tensorflow
  from tensorflow.keras.layers import Input, InputLayer
  from alibi_detect.ad import AdversarialAE, ModelDistillation
  from alibi_detect.cd import ChiSquareDrift, ClassifierDrift, KSDrift, MMDDrift, TabularDrift
  from alibi_detect.cd.tensorflow import UAE, HiddenOutput
  from alibi_detect.cd.tensorflow.classifier import ClassifierDriftTF
  from alibi_detect.cd.tensorflow.mmd import MMDDriftTF
  from alibi_detect.models.tensorflow import TransformerEmbedding
  from alibi_detect.od import LLR, IForest, Mahalanobis, OutlierAE, OutlierAEGMM, OutlierProphet, OutlierSeq2Seq, OutlierVAE, OutlierVAEGMM, SpectralResidual
  from alibi_detect.utils._types import Literal
  from alibi_detect.utils.tensorflow.kernels import GaussianRBF
  from alibi_detect.utils.missing_optional_dependency import MissingDependency
  from alibi_detect.utils.frameworks import Framework
label_desc: Use image node_id 3 for calling a global function with example usage: save_embedding_config(embed, base_path, local_path) and returns: cfg_embed