docstr: :param data: Either a pandas DataFrame, numpy.ndarray or a dictionary.
  
               Dictionary input is expected to be a valid ONNX model feed dictionary.
  
               Numpy array input is supported iff the model has a single tensor input and is
               converted into an ONNX feed dictionary with the appropriate key.
  
               Pandas DataFrame is converted to ONNX inputs as follows:
                  - If the underlying ONNX model only defines a *single* input tensor, the
                    DataFrame's values are converted to a NumPy array representation using the
                   `DataFrame.values()
                   <https://pandas.pydata.org/pandas-docs/stable/reference/api/
                    pandas.DataFrame.values.html#pandas.DataFrame.values>`_ method.
                  - If the underlying ONNX model defines *multiple* input tensors, each column
                    of the DataFrame is converted to a NumPy array representation.
  
                For more information about the ONNX Runtime, see
                `<https://github.com/microsoft/onnxruntime>`_.
  :param params: Additional parameters to pass to the model for inference.
  
                 .. Note:: Experimental: This parameter may change or be removed in a future
                                         release without warning.
  :return: Model predictions. If the input is a pandas.DataFrame, the predictions are returned
           in a pandas.DataFrame. If the input is a numpy array or a dictionary the
           predictions are returned in a dictionary.
docstr_tok: [":","param","data",":","Either","a","pandas","DataFrame",",","numpy.ndarray","or","a","dictionary",".","Dictionary","input","is","expected","to","be","a","valid","ONNX","model","feed","dictionary",".","Numpy","array","input","is","supported","iff","the","model","has","a","single","tensor","input","and","is","converted","into","an","ONNX","feed","dictionary","with","the","appropriate","key",".","Pandas","DataFrame","is","converted","to","ONNX","inputs","as","follows",":","-","If","the","underlying","ONNX","model","only","defines","a","*","single","*","input","tensor",",","the","DataFrame","'s","values","are","converted","to","a","NumPy","array","representation","using","the","`","DataFrame.values","(",")","<","https",":","\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/","pandas.DataFrame.values.html","#","pandas.DataFrame.values",">","`","_","method",".","-","If","the","underlying","ONNX","model","defines","*","multiple","*","input","tensors",",","each","column","of","the","DataFrame","is","converted","to","a","NumPy","array","representation",".","For","more","information","about","the","ONNX","Runtime",",","see","`","<","https",":","\/\/github.com\/microsoft\/onnxruntime",">","`","_",".",":","param","params",":","Additional","parameters","to","pass","to","the","model","for","inference",".","..","Note",":",":","Experimental",":","This","parameter","may","change","or","be","removed","in","a","future","release","without","warning",".",":","return",":","Model","predictions",".","If","the","input","is","a","pandas.DataFrame",",","the","predictions","are","returned","in","a","pandas.DataFrame",".","If","the","input","is","a","numpy","array","or","a","dictionary","the","predictions","are","returned","in","a","dictionary","."]
code: def predict(
      self, data, params: Optional[Dict[str, Any]] = None
  ):  # pylint: disable=unused-argument
      """
      :param data: Either a pandas DataFrame, numpy.ndarray or a dictionary.
  
                   Dictionary input is expected to be a valid ONNX model feed dictionary.
  
                   Numpy array input is supported iff the model has a single tensor input and is
                   converted into an ONNX feed dictionary with the appropriate key.
  
                   Pandas DataFrame is converted to ONNX inputs as follows:
                      - If the underlying ONNX model only defines a *single* input tensor, the
                        DataFrame's values are converted to a NumPy array representation using the
                       `DataFrame.values()
                       <https://pandas.pydata.org/pandas-docs/stable/reference/api/
                        pandas.DataFrame.values.html#pandas.DataFrame.values>`_ method.
                      - If the underlying ONNX model defines *multiple* input tensors, each column
                        of the DataFrame is converted to a NumPy array representation.
  
                    For more information about the ONNX Runtime, see
                    `<https://github.com/microsoft/onnxruntime>`_.
      :param params: Additional parameters to pass to the model for inference.
  
                     .. Note:: Experimental: This parameter may change or be removed in a future
                                             release without warning.
      :return: Model predictions. If the input is a pandas.DataFrame, the predictions are returned
               in a pandas.DataFrame. If the input is a numpy array or a dictionary the
               predictions are returned in a dictionary.
      """
      if isinstance(data, dict):
          feed_dict = data
      elif isinstance(data, np.ndarray):
          # NB: We do allow scoring with a single tensor (ndarray) in order to be compatible with
          # supported pyfunc inputs iff the model has a single input. The passed tensor is
          # assumed to be the first input.
          if len(self.inputs) != 1:
              inputs = [x[0] for x in self.inputs]
              raise MlflowException(
                  "Unable to map numpy array input to the expected model "
                  "input. "
                  "Numpy arrays can only be used as input for MLflow ONNX "
                  "models that have a single input. This model requires "
                  f"{len(self.inputs)} inputs. Please pass in data as either a "
                  "dictionary or a DataFrame with the following tensors"
                  f": {inputs}."
              )
          feed_dict = {self.inputs[0][0]: data}
      elif isinstance(data, pd.DataFrame):
          if len(self.inputs) > 1:
              feed_dict = {
                  name: data[name].values for (name, _) in self.inputs
              }
          else:
              feed_dict = {self.inputs[0][0]: data.values}
  
      else:
          raise TypeError(
              "Input should be a dictionary or a numpy array or a pandas.DataFrame, "
              f"got '{type(data)}'"
          )
  
      # ONNXRuntime throws the following exception for some operators when the input
      # contains float64 values. Unfortunately, even if the original user-supplied input
      # did not contain float64 values, the serialization/deserialization between the
      # client and the scoring server can introduce 64-bit floats. This is being tracked in
      # https://github.com/mlflow/mlflow/issues/1286. Meanwhile, we explicitly cast the input to
      # 32-bit floats when needed. TODO: Remove explicit casting when issue #1286 is fixed.
      feed_dict = self._cast_float64_to_float32(feed_dict)
      predicted = self.rt.run(self.output_names, feed_dict)
  
      if isinstance(data, pd.DataFrame):
  
          def format_output(data):
              # Output can be list and it should be converted to a numpy array
              # https://github.com/mlflow/mlflow/issues/2499
              data = np.asarray(data)
              return data.reshape(-1)
  
          return pd.DataFrame.from_dict(
              {
                  c: format_output(p)
                  for (c, p) in zip(self.output_names, predicted)
              }
          )
      else:
          return dict(zip(self.output_names, predicted))
  
imports: import logging
  import os
  from pathlib import Path
  from typing import Any, Dict, Optional
  import numpy
  import pandas
  import yaml
  from packaging.version import Version
  import mlflow.tracking
  from mlflow import pyfunc
  from mlflow.exceptions import MlflowException
  from mlflow.models import Model, ModelInputExample, ModelSignature
  from mlflow.models.model import MLMODEL_FILE_NAME
  from mlflow.models.utils import _save_example
  from mlflow.tracking._model_registry import DEFAULT_AWAIT_MAX_SLEEP_SECONDS
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
  from mlflow.utils.docstring_utils import LOG_MODEL_PARAM_DOCS, 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, _get_flavor_configuration, _validate_and_copy_code_paths, _validate_and_prepare_target_save_path, _validate_onnx_session_options
  from mlflow.utils.requirements_utils import _get_pinned_requirement
label_desc: Use image node_id 3 for calling the _OnnxModelWrapper obj's underlying member method code with example usage: obj.predict(data, params) and returns: pd, dict, data