code: def evaluate(predictor, df, onnx_session=None):
      labels = df["score"].to_numpy()
  
      if not onnx_session:
          QEmb = predictor.extract_embedding(df[["sentence1"]])[
              "sentence1"
          ]
          AEmb = predictor.extract_embedding(df[["sentence2"]])[
              "sentence2"
          ]
      else:
          QEmb = onnx_session.run(
              None,
              predictor._learner.get_processed_batch_for_deployment(
                  data=df[["sentence1"]]
              ),
          )[0]
          AEmb = onnx_session.run(
              None,
              predictor._learner.get_processed_batch_for_deployment(
                  data=df[["sentence2"]]
              ),
          )[0]
  
      cosine_scores = 1 - paired_cosine_distances(QEmb, AEmb)
      eval_pearson_cosine, _ = pearsonr(labels, cosine_scores)
      eval_spearman_cosine, _ = spearmanr(labels, cosine_scores)
  
      return eval_pearson_cosine, eval_spearman_cosine
  
file_path: autogluon/multimodal/tests/unittests/others/test_deployment_onnx.py
imports: import os
  import shutil
  import numpy
  import numpy.testing
  import pytest
  from packaging import version
  from scipy.stats import pearsonr, spearmanr
  from sklearn.metrics.pairwise import paired_cosine_distances
  from autogluon.multimodal import MultiModalPredictor
  from autogluon.multimodal.constants import REGRESSION
  from autogluon.multimodal.utils.misc import shopee_dataset
  from autogluon.multimodal.utils.onnx import OnnxModule
  from ..utils.unittest_datasets import AEDataset, PetFinderDataset
label_desc: Use image node_id 1 for calling a global function with example usage: evaluate(predictor, df, onnx_session) and returns: eval_pearson_cosine,  eval_spearman_cosine