class_docstr: Loads a saved AdaptiveModel/ONNXAdaptiveModel from disk and runs it in inference mode. Can be used for a
  model with prediction head (down-stream predictions) and without (using LM as embedder).
  
  Example usage:
  
  .. code-block:: python
  
     # down-stream inference
     basic_texts = [
         {"text": "Schartau sagte dem Tagesspiegel, dass Fischer ein Idiot sei"},
         {"text": "Martin Müller spielt Handball in Berlin"},
     ]
     model = Inferencer.load(your_model_dir)
     model.inference_from_dicts(dicts=basic_texts)
     # LM embeddings
     model = Inferencer.load(your_model_dir, extraction_strategy="cls_token", extraction_layer=-1)
     model.inference_from_dicts(dicts=basic_texts)
docstr: Feed a preprocessed dataset to the model and get the actual predictions (forward pass + formatting).
  
  :param dataset: PyTorch Dataset with samples you want to predict
  :param tensor_names: Names of the tensors in the dataset
  :param baskets: For each item in the dataset, we need additional information to create formatted preds.
                  Baskets contain all relevant infos for that.
                  Example: QA - input string to convert the predicted answer from indices back to string space
  :return: list of predictions
docstr_tok: ["Feed","a","preprocessed","dataset","to","the","model","and","get","the","actual","predictions","(","forward","pass","+","formatting",")",".",":","param","dataset",":","PyTorch","Dataset","with","samples","you","want","to","predict",":","param","tensor_names",":","Names","of","the","tensors","in","the","dataset",":","param","baskets",":","For","each","item","in","the","dataset",",","we","need","additional","information","to","create","formatted","preds",".","Baskets","contain","all","relevant","infos","for","that",".","Example",":","QA","-","input","string","to","convert","the","predicted","answer","from","indices","back","to","string","space",":","return",":","list","of","predictions"]
code: def _get_predictions(self, dataset, tensor_names, baskets):
      """
      Feed a preprocessed dataset to the model and get the actual predictions (forward pass + formatting).
  
      :param dataset: PyTorch Dataset with samples you want to predict
      :param tensor_names: Names of the tensors in the dataset
      :param baskets: For each item in the dataset, we need additional information to create formatted preds.
                      Baskets contain all relevant infos for that.
                      Example: QA - input string to convert the predicted answer from indices back to string space
      :return: list of predictions
      """
      samples = [s for b in baskets for s in b.samples]
  
      data_loader = NamedDataLoader(
          dataset=dataset,
          sampler=SequentialSampler(dataset),
          batch_size=self.batch_size,
          tensor_names=tensor_names,
      )
      preds_all = []
      for i, batch in enumerate(
          tqdm(
              data_loader,
              desc=f"Inferencing Samples",
              unit=" Batches",
              disable=self.disable_tqdm,
          )
      ):
          batch = {key: batch[key].to(self.device) for key in batch}
          batch_samples = samples[
              i * self.batch_size : (i + 1) * self.batch_size
          ]
  
          # get logits
          with torch.no_grad():
              logits = self.model.forward(**batch)
              preds = self.model.formatted_preds(
                  logits=logits,
                  samples=batch_samples,
                  tokenizer=self.processor.tokenizer,
                  return_class_probs=self.return_class_probs,
                  **batch,
              )
              preds_all += preds
      return preds_all
  
imports: import logging
  import multiprocessing
  import os
  from functools import partial
  import warnings
  import torch
  from torch.utils.data.sampler import SequentialSampler
  from tqdm import tqdm
  from typing import Generator, List, Union
  from farm.data_handler.dataloader import NamedDataLoader
  from farm.data_handler.processor import Processor, InferenceProcessor, NaturalQuestionsProcessor
  from farm.data_handler.utils import grouper
  from farm.data_handler.inputs import QAInput
  from farm.modeling.adaptive_model import AdaptiveModel, BaseAdaptiveModel, ONNXAdaptiveModel
  from farm.modeling.optimization import optimize_model
  from farm.utils import initialize_device_settings, MLFlowLogger
  from farm.utils import set_all_seeds, calc_chunksize, log_ascii_workers, Benchmarker
  from farm.modeling.predictions import QAPred
label_desc: Use image node_id 11 for calling the Inferencer obj's underlying member method code with example usage: obj._get_predictions(dataset, tensor_names, baskets) and returns: preds_all