code: def evaluate(predictor, df, onnx_session=None):
      labels = df["score"].to_numpy()
  
      # TODO: line below only outputs one embedding since dataloader merge text columns automatically
      # mixEmb =  predictor.extract_embedding(valid_df[["sentence1","sentence2"]])["sentence1_sentence2"]
      if not onnx_session:
          QEmb = predictor.extract_embedding(df[["sentence1"]])[
              "sentence1"
          ]
          AEmb = predictor.extract_embedding(df[["sentence2"]])[
              "sentence2"
          ]
      else:
          valid_input = [
              "hf_text_text_token_ids",
              "hf_text_text_valid_length",
              "hf_text_text_segment_ids",
          ]
          QEmb = onnx_session.run(
              None,
              predictor.get_processed_batch_for_deployment(
                  data=df[["sentence1"]], valid_input=valid_input
              ),
          )[0]
          AEmb = onnx_session.run(
              None,
              predictor.get_processed_batch_for_deployment(
                  data=df[["sentence2"]], valid_input=valid_input
              ),
          )[0]
  
      cosine_scores = 1 - paired_cosine_distances(QEmb, AEmb)
      eval_pearson_cosine, _ = pearsonr(labels, cosine_scores)
      eval_spearman_cosine, _ = spearmanr(labels, cosine_scores)
  
      print(eval_pearson_cosine)
      print(eval_spearman_cosine)
  
      return eval_pearson_cosine, eval_spearman_cosine
  
file_path: autogluon/examples/automm/pipeline/feature_extraction_example.py
imports: import argparse
  from autogluon.multimodal import MultiModalPredictor
  from datasets import load_dataset
  import time
  from sklearn.metrics.pairwise import paired_cosine_distances
  from scipy.stats import pearsonr, spearmanr
  import numpy
  import onnx
  import onnxruntime
  import torch
  from torch import tensor
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