code: def log_model(
      model,
      artifact_path: str,
      inference_config: Optional[Dict[str, Any]] = None,
      code_paths: Optional[List[str]] = None,
      registered_model_name: Optional[str] = None,
      signature: Optional[ModelSignature] = None,
      input_example: Optional[ModelInputExample] = None,
      await_registration_for=DEFAULT_AWAIT_MAX_SLEEP_SECONDS,
      pip_requirements: Optional[Union[List[str], str]] = None,
      extra_pip_requirements: Optional[Union[List[str], str]] = None,
      conda_env=None,
      metadata: Optional[Dict[str, Any]] = None,
  ):
      """
      Log a ``sentence_transformers`` model as an MLflow artifact for the current run.
  
      :param model: A trained ``sentence-transformers`` model.
  
      .. code-block:: python
  
          # An example of using log_model for a sentence-transformers model and architecture:
  
          from sentence_transformers import SentenceTransformer
          import mlflow
  
          model = SentenceTransformer("all-MiniLM-L6-v2")
          data = "MLflow is awesome!"
          signature = mlflow.models.infer_signature(
              model_input=data,
              model_output=model.encode(data),
          )
  
          with mlflow.start_run():
              mlflow.sentence_transformers.log_model(
                  model=model,
                  artifact_path="sbert_model",
                  signature=signature,
                  input_example=data,
              )
  
  
  
      :param artifact_path: Local path destination for the serialized model to be saved.
      :param inference_config:
          A dict of valid overrides that can be applied to a ``sentence-transformer`` model instance
          during inference.
          These arguments are used exclusively for the case of loading the model as a ``pyfunc``
          Model or for use in Spark.
          These values are not applied to a returned model from a call to
          ``mlflow.sentence_transformers.load_model()``
      :param code_paths: A list of local filesystem paths to Python file dependencies (or directories
                         containing file dependencies). These files are *prepended* to the system
                         path when the model is loaded.
      :param registered_model_name: This argument may change or be removed in a
                                    future release without warning. If given, create a model
                                    version under ``registered_model_name``, also creating a
                                    registered model if one with the given name does not exist.
      :param signature: an instance of the :py:class:`ModelSignature <mlflow.models.ModelSignature>`
                        class that describes the model's inputs and outputs. If not specified but an
                        ``input_example`` is supplied, a signature will be automatically inferred
                        based on the supplied input example and model. If both ``signature`` and
                        ``input_example`` are not specified or the automatic signature inference
                        fails, a default signature will be adopted. To prevent a signature from being
                        adopted, set ``signature`` to ``False``. To manually infer a model signature,
                        call :py:func:`infer_signature() <mlflow.models.infer_signature>` on datasets
                        with valid model inputs and valid model outputs.
      :param input_example: {{ input_example }}
      :param pip_requirements: {{ pip_requirements }}
      :param extra_pip_requirements: {{ extra_pip_requirements }}
      :param conda_env: {{ conda_env }}
      :param metadata: Custom metadata dictionary passed to the model and stored in the MLmodel file.
  
                       .. Note:: Experimental: This parameter may change or be removed in a future
                                               release without warning.
  
      """
      return Model.log(
          artifact_path=artifact_path,
          flavor=mlflow.sentence_transformers,
          registered_model_name=registered_model_name,
          await_registration_for=await_registration_for,
          metadata=metadata,
          model=model,
          inference_config=inference_config,
          conda_env=conda_env,
          code_paths=code_paths,
          signature=signature,
          input_example=input_example,
          pip_requirements=pip_requirements,
          extra_pip_requirements=extra_pip_requirements,
      )
  
imports: import json
  import logging
  import pathlib
  from typing import Any, Dict, List, Optional, Union
  import numpy
  import pandas
  import yaml
  import mlflow
  from mlflow import pyfunc
  from mlflow.exceptions import MlflowException
  from mlflow.models import Model, ModelInputExample, ModelSignature, infer_pip_requirements
  from mlflow.models.model import MLMODEL_FILE_NAME
  from mlflow.models.signature import _infer_signature_from_input_example
  from mlflow.models.utils import _save_example
  from mlflow.tracking._model_registry import DEFAULT_AWAIT_MAX_SLEEP_SECONDS
  from mlflow.types.schema import ColSpec, Schema, TensorSpec
  from mlflow.utils.annotations import experimental
  from mlflow.utils.docstring_utils import LOG_MODEL_PARAM_DOCS, docstring_version_compatibility_warning, format_docstring
  from mlflow.utils.environment import _CONDA_ENV_FILE_NAME, _CONSTRAINTS_FILE_NAME, _PYTHON_ENV_FILE_NAME, _REQUIREMENTS_FILE_NAME, _mlflow_conda_env, _process_conda_env, _process_pip_requirements, _PythonEnv, _validate_env_arguments
  from mlflow.utils.file_utils import get_total_file_size, write_to
  from mlflow.utils.model_utils import _add_code_from_conf_to_system_path, _download_artifact_from_uri, _get_flavor_configuration_from_uri, _validate_and_copy_code_paths, _validate_and_prepare_target_save_path
  from mlflow.utils.requirements_utils import _get_pinned_requirement
label_desc: Use image node_id 4 for calling a global function with example usage: log_model(model, artifact_path, inference_config, code_paths, registered_model_name, signature, input_example, await_registration_for, pip_requirements, extra_pip_requirements, conda_env, metadata) and returns: Model