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: Loads a full sentence-transformers model
code: def _load_sbert_model(
      self,
      model_name_or_path: str,
      token: Optional[Union[bool, str]],
      cache_folder: Optional[str],
      trust_remote_code: bool = False,
  ):
      """
      Loads a full sentence-transformers model
      """
      # Check if the config_sentence_transformers.json file exists (exists since v2 of the framework)
      config_sentence_transformers_json_path = load_file_path(
          model_name_or_path,
          "config_sentence_transformers.json",
          token=token,
          cache_folder=cache_folder,
      )
      if config_sentence_transformers_json_path is not None:
          with open(config_sentence_transformers_json_path) as fIn:
              self._model_config = json.load(fIn)
  
          if (
              "__version__" in self._model_config
              and "sentence_transformers"
              in self._model_config["__version__"]
              and self._model_config["__version__"][
                  "sentence_transformers"
              ]
              > __version__
          ):
              logger.warning(
                  "You try to use a model that was created with version {}, however, your version is {}. This might cause unexpected behavior or errors. In that case, try to update to the latest version.\n\n\n".format(
                      self._model_config["__version__"][
                          "sentence_transformers"
                      ],
                      __version__,
                  )
              )
  
      # Check if a readme exists
      model_card_path = load_file_path(
          model_name_or_path,
          "README.md",
          token=token,
          cache_folder=cache_folder,
      )
      if model_card_path is not None:
          try:
              with open(model_card_path, encoding="utf8") as fIn:
                  self._model_card_text = fIn.read()
          except Exception:
              pass
  
      # Load the modules of sentence transformer
      modules_json_path = load_file_path(
          model_name_or_path,
          "modules.json",
          token=token,
          cache_folder=cache_folder,
      )
      with open(modules_json_path) as fIn:
          modules_config = json.load(fIn)
  
      modules = OrderedDict()
      for module_config in modules_config:
          module_class = import_from_string(module_config["type"])
          # For Transformer, don't load the full directory, rely on `transformers` instead
          # But, do load the config file first.
          if (
              module_class == Transformer
              and module_config["path"] == ""
          ):
              kwargs = {}
              for config_name in [
                  "sentence_bert_config.json",
                  "sentence_roberta_config.json",
                  "sentence_distilbert_config.json",
                  "sentence_camembert_config.json",
                  "sentence_albert_config.json",
                  "sentence_xlm-roberta_config.json",
                  "sentence_xlnet_config.json",
              ]:
                  config_path = load_file_path(
                      model_name_or_path,
                      config_name,
                      token=token,
                      cache_folder=cache_folder,
                  )
                  if config_path is not None:
                      with open(config_path) as fIn:
                          kwargs = json.load(fIn)
                      break
              if "model_args" in kwargs:
                  kwargs["model_args"].update(
                      {
                          "token": token,
                          "trust_remote_code": trust_remote_code,
                      }
                  )
              else:
                  kwargs["model_args"] = {
                      "token": token,
                      "trust_remote_code": trust_remote_code,
                  }
              if "tokenizer_args" in kwargs:
                  kwargs["tokenizer_args"].update(
                      {
                          "token": token,
                          "trust_remote_code": trust_remote_code,
                      }
                  )
              else:
                  kwargs["tokenizer_args"] = {
                      "token": token,
                      "trust_remote_code": trust_remote_code,
                  }
              module = Transformer(
                  model_name_or_path, cache_dir=cache_folder, **kwargs
              )
          else:
              module_path = load_dir_path(
                  model_name_or_path,
                  module_config["path"],
                  token=token,
                  cache_folder=cache_folder,
              )
              module = module_class.load(module_path)
          modules[module_config["name"]] = module
  
      return modules
  
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 23 for calling the SentenceTransformer obj's underlying member method code with example usage: obj._load_sbert_model(model_name_or_path, token, cache_folder, trust_remote_code) and returns: modules