code: def to_inference_model_input_from_series(
      s: pd.Series,
      feature_type: str,
      load_paths: bool = False,
      feature_config: Optional[FeatureConfigDict] = None,
  ) -> TorchscriptPreprocessingInput:
      """Converts a pandas Series to be compatible with a torchscripted InferenceModule forward pass."""
      if feature_type == IMAGE:
          if load_paths:
              return [
                  read_image_from_path(v) if isinstance(v, str) else v
                  for v in s
              ]
      elif feature_type == AUDIO:
          if load_paths:
              return [
                  read_audio_from_path(v) if isinstance(v, str) else v
                  for v in s
              ]
      elif feature_type == DATE:
          if feature_config is None:
              raise ValueError(
                  '"date" feature type requires the associated feature config to be provided.'
              )
          datetime_format = feature_config["preprocessing"][
              "datetime_format"
          ]
          return [
              torch.tensor(
                  create_vector_from_datetime_obj(
                      datetime.strptime(v, datetime_format)
                  )
              )
              for v in s
          ]
      elif feature_type in FEATURES_TO_CAST_AS_STRINGS:
          return s.astype(str).to_list()
      return torch.from_numpy(s.to_numpy())
  
file_path: ludwig/ludwig/utils/inference_utils.py
imports: from datetime import datetime
  from typing import Dict, Optional
  import pandas
  import torch
  from ludwig.constants import AUDIO, BAG, BINARY, CATEGORY, COLUMN, DATE, IMAGE, NAME, POSTPROCESSOR, PREDICTOR, PREPROCESSOR, SEQUENCE, SET, TEXT, TIMESERIES, TYPE, VECTOR
  from ludwig.types import FeatureConfigDict, ModelConfigDict
  from ludwig.utils.audio_utils import read_audio_from_path
  from ludwig.utils.date_utils import create_vector_from_datetime_obj
  from ludwig.utils.image_utils import read_image_from_path
  from ludwig.utils.torch_utils import place_on_device
  from ludwig.utils.types import TorchDevice, TorchscriptPreprocessingInput
label_desc: Use image node_id 3 for calling a global function with example usage: to_inference_model_input_from_series(s, feature_type, load_paths, feature_config) and returns: torch, unknown, unknown, unknown, s