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: Converts a text into vector(s) using the language model only (no prediction head involved).
  
  Example:
      basic_texts = [{"text": "Some text we want to embed"}, {"text": "And a second one"}]
      result = inferencer.extract_vectors(dicts=basic_texts)
  
  :param dicts: Samples to run inference on provided as a list of dicts. One dict per sample.
  :type dicts: [dict]
  :param extraction_strategy: Strategy to extract vectors. Choices: 'cls_token' (sentence vector), 'reduce_mean'
                         (sentence vector), reduce_max (sentence vector), 'per_token' (individual token vectors)
  :type extraction_strategy: str
  :param extraction_layer: number of layer from which the embeddings shall be extracted. Default: -1 (very last layer).
  :type extraction_layer: int
  :return: dict of predictions
docstr_tok: ["Converts","a","text","into","vector","(","s",")","using","the","language","model","only","(","no","prediction","head","involved",")",".","Example",":","basic_texts","=","[","{","``","text","''",":","``","Some","text","we","want","to","embed","''","}",",","{","``","text","''",":","``","And","a","second","one","''","}","]","result","=","inferencer.extract_vectors","(","dicts=basic_texts",")",":","param","dicts",":","Samples","to","run","inference","on","provided","as","a","list","of","dicts",".","One","dict","per","sample",".",":","type","dicts",":","[","dict","]",":","param","extraction_strategy",":","Strategy","to","extract","vectors",".","Choices",":","'cls_token","'","(","sentence","vector",")",",","'reduce_mean'","(","sentence","vector",")",",","reduce_max","(","sentence","vector",")",",","'per_token","'","(","individual","token","vectors",")",":","type","extraction_strategy",":","str",":","param","extraction_layer",":","number","of","layer","from","which","the","embeddings","shall","be","extracted",".","Default",":","-1","(","very","last","layer",")",".",":","type","extraction_layer",":","int",":","return",":","dict","of","predictions"]
code: def extract_vectors(
      self, dicts, extraction_strategy="cls_token", extraction_layer=-1
  ):
      """
      Converts a text into vector(s) using the language model only (no prediction head involved).
  
      Example:
          basic_texts = [{"text": "Some text we want to embed"}, {"text": "And a second one"}]
          result = inferencer.extract_vectors(dicts=basic_texts)
  
      :param dicts: Samples to run inference on provided as a list of dicts. One dict per sample.
      :type dicts: [dict]
      :param extraction_strategy: Strategy to extract vectors. Choices: 'cls_token' (sentence vector), 'reduce_mean'
                             (sentence vector), reduce_max (sentence vector), 'per_token' (individual token vectors)
      :type extraction_strategy: str
      :param extraction_layer: number of layer from which the embeddings shall be extracted. Default: -1 (very last layer).
      :type extraction_layer: int
      :return: dict of predictions
      """
  
      logger.warning(
          "Deprecated! Please use Inferencer.inference_from_dicts() instead."
      )
      self.model.prediction_heads = torch.nn.ModuleList([])
      self.model.language_model.extraction_layer = extraction_layer
      self.model.language_model.extraction_strategy = (
          extraction_strategy
      )
  
      return self.inference_from_dicts(dicts)
  
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 13 for calling the Inferencer obj's underlying member method code with example usage: obj.extract_vectors(dicts, extraction_strategy, extraction_layer) and returns: self