code: def _get_model_type_from_template(tmpl: str) -> str:
      """
      :param tmpl: The template kind, e.g. `regression/v1`.
      :return: A model type literal compatible with the mlflow evaluation service, e.g. regressor.
      """
      if tmpl == "regression/v1":
          return "regressor"
      if tmpl == "classification/v1":
          return "classifier"
      raise MlflowException(
          f"No model type for template kind {tmpl}",
          error_code=INVALID_PARAMETER_VALUE,
      )
  
file_path: mlflow/mlflow/recipes/utils/metrics.py
imports: import importlib
  import logging
  import sys
  from typing import Any, Dict, List, Optional
  from mlflow.exceptions import BAD_REQUEST, MlflowException
  from mlflow.models import EvaluationMetric, make_metric
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
label_desc: Use image node_id 3 for calling a global function with example usage: _get_model_type_from_template(tmpl) and returns: str, str