class_docstr: Loads or creates a SentenceTransformer model that can be used to map sentences / text to embeddings.
  
  :param model_name_or_path: If it is a filepath on disc, it loads the model from that path. If it is not a path,
      it first tries to download a pre-trained SentenceTransformer model. If that fails, tries to construct a model
      from the Hugging Face Hub with that name.
  :param modules: A list of torch Modules that should be called sequentially, can be used to create custom
      SentenceTransformer models from scratch.
  :param device: Device (like "cuda", "cpu", "mps") that should be used for computation. If None, checks if a GPU
      can be used.
  :param cache_folder: Path to store models. Can also be set by the SENTENCE_TRANSFORMERS_HOME environment variable.
  :param trust_remote_code: Whether or not to allow for custom models defined on the Hub in their own modeling files.
      This option should only be set to True for repositories you trust and in which you have read the code, as it
      will execute code present on the Hub on your local machine.
  :param token: Hugging Face authentication token to download private models.
class_docstr_tok: ["Loads","or","creates","a","SentenceTransformer","model","that","can","be","used","to","map","sentences","\/","text","to","embeddings",".",":","param","model_name_or_path",":","If","it","is","a","filepath","on","disc",",","it","loads","the","model","from","that","path",".","If","it","is","not","a","path",",","it","first","tries","to","download","a","pre-trained","SentenceTransformer","model",".","If","that","fails",",","tries","to","construct","a","model","from","the","Hugging","Face","Hub","with","that","name",".",":","param","modules",":","A","list","of","torch","Modules","that","should","be","called","sequentially",",","can","be","used","to","create","custom","SentenceTransformer","models","from","scratch",".",":","param","device",":","Device","(","like","``","cuda","''",",","``","cpu","''",",","``","mps","''",")","that","should","be","used","for","computation",".","If","None",",","checks","if","a","GPU","can","be","used",".",":","param","cache_folder",":","Path","to","store","models",".","Can","also","be","set","by","the","SENTENCE_TRANSFORMERS_HOME","environment","variable",".",":","param","trust_remote_code",":","Whether","or","not","to","allow","for","custom","models","defined","on","the","Hub","in","their","own","modeling","files",".","This","option","should","only","be","set","to","True","for","repositories","you","trust","and","in","which","you","have","read","the","code",",","as","it","will","execute","code","present","on","the","Hub","on","your","local","machine",".",":","param","token",":","Hugging","Face","authentication","token","to","download","private","models","."]
docstr: Starts multi process to process the encoding with several, independent processes.
  This method is recommended if you want to encode on multiple GPUs or CPUs. It is advised
  to start only one process per GPU. This method works together with encode_multi_process
  and stop_multi_process_pool.
  
  :param target_devices: PyTorch target devices, e.g. ["cuda:0", "cuda:1", ...] or ["cpu", "cpu", "cpu", "cpu"].
      If target_devices is None and CUDA is available, then all available CUDA devices will be used. If
      target_devices is None and CUDA is not available, then 4 CPU devices will be used.
  :return: Returns a dict with the target processes, an input queue and and output queue.
code: def start_multi_process_pool(self, target_devices: List[str] = None):
      """
      Starts multi process to process the encoding with several, independent processes.
      This method is recommended if you want to encode on multiple GPUs or CPUs. It is advised
      to start only one process per GPU. This method works together with encode_multi_process
      and stop_multi_process_pool.
  
      :param target_devices: PyTorch target devices, e.g. ["cuda:0", "cuda:1", ...] or ["cpu", "cpu", "cpu", "cpu"].
          If target_devices is None and CUDA is available, then all available CUDA devices will be used. If
          target_devices is None and CUDA is not available, then 4 CPU devices will be used.
      :return: Returns a dict with the target processes, an input queue and and output queue.
      """
      if target_devices is None:
          if torch.cuda.is_available():
              target_devices = [
                  "cuda:{}".format(i)
                  for i in range(torch.cuda.device_count())
              ]
          else:
              logger.info(
                  "CUDA is not available. Starting 4 CPU workers"
              )
              target_devices = ["cpu"] * 4
  
      logger.info(
          "Start multi-process pool on devices: {}".format(
              ", ".join(map(str, target_devices))
          )
      )
  
      self.to("cpu")
      self.share_memory()
      ctx = mp.get_context("spawn")
      input_queue = ctx.Queue()
      output_queue = ctx.Queue()
      processes = []
  
      for device_id in target_devices:
          p = ctx.Process(
              target=SentenceTransformer._encode_multi_process_worker,
              args=(device_id, self, input_queue, output_queue),
              daemon=True,
          )
          p.start()
          processes.append(p)
  
      return {
          "input": input_queue,
          "output": output_queue,
          "processes": processes,
      }
  
imports: import json
  import logging
  import os
  import shutil
  from collections import OrderedDict
  import warnings
  from typing import List, Dict, Tuple, Iterable, Type, Union, Callable, Optional, Literal, TYPE_CHECKING
  import numpy
  from numpy import ndarray
  import transformers
  from huggingface_hub import HfApi
  import torch
  from torch import nn, Tensor, device
  from torch.optim import Optimizer
  from torch.utils.data import DataLoader
  import torch.multiprocessing
  from tqdm.autonotebook import trange
  import math
  import queue
  import tempfile
  from .None import __MODEL_HUB_ORGANIZATION__
  from .evaluation import SentenceEvaluator
  from .util import import_from_string, batch_to_device, fullname, is_sentence_transformer_model, load_dir_path, load_file_path, save_to_hub_args_decorator
  from .models import Transformer, Pooling
  from .model_card_templates import ModelCardTemplate
  from .None import __version__
label_desc: Use image node_id 3 for calling the SentenceTransformer obj's underlying member method code with example usage: obj.start_multi_process_pool(target_devices) and returns: dict