code: def create_semantic_retrieval_model_evaluator(
      model: "SentenceTransformer", samples: List[str]
  ) -> Type[BatchSizeEvaluator]:
      class _RetrievalModelEvaluator(BatchSizeEvaluator):
          def __init__(self):
              self.model = model.to(get_torch_device())
              self.samples = samples
  
          def step(self, batch_size: int):
              self.model.encode(
                  self.samples[:batch_size],
                  batch_size=batch_size,
                  show_progress_bar=False,
              )
  
      return _RetrievalModelEvaluator
  
imports: import hashlib
  import json
  import os
  from abc import ABC, abstractmethod
  from typing import Any, Callable, Dict, List, Optional, Type, TYPE_CHECKING, Union
  import numpy
  import pandas
  from tqdm import tqdm
  from ludwig.vector_index import FAISS, get_vector_index_cls
  from ludwig.vector_index.base import VectorIndex
  from ludwig.utils.batch_size_tuner import BatchSizeEvaluator
  from ludwig.utils.torch_utils import get_torch_device
label_desc: Use image node_id 3 for calling a global function with example usage: create_semantic_retrieval_model_evaluator(model, samples) and returns: _RetrievalModelEvaluator