class_docstr: A component for embedding strings using Sentence Transformers models.
  
  Usage example:
  ```python
  from haystack.components.embedders import SentenceTransformersTextEmbedder
  
  text_to_embed = "I love pizza!"
  
  text_embedder = SentenceTransformersTextEmbedder()
  text_embedder.warm_up()
  
  print(text_embedder.run(text_to_embed))
  
  # {'embedding': [-0.07804739475250244, 0.1498992145061493,, ...]}
  ```
docstr: Create a SentenceTransformersTextEmbedder component.
  
  :param model: Local path or name of the model in Hugging Face's model hub,
      such as ``'sentence-transformers/all-mpnet-base-v2'``.
  :param device: Device (like 'cuda' / 'cpu') that should be used for computation.
      Defaults to CPU.
  :param token: The API token used to download private models from Hugging Face.
      If this parameter is set to `True`, then the token generated when running
      `transformers-cli login` (stored in ~/.huggingface) will be used.
  :param prefix: A string to add to the beginning of each Document text before embedding.
      Can be used to prepend the text with an instruction, as required by some embedding models,
      such as E5 and bge.
  :param suffix: A string to add to the end of each text.
  :param batch_size: Number of strings to encode at once.
  :param progress_bar: If true, displays progress bar during embedding.
  :param normalize_embeddings: If set to true, returned vectors will have length 1.
code: def __init__(
      self,
      model: str = "sentence-transformers/all-mpnet-base-v2",
      device: Optional[str] = None,
      token: Union[bool, str, None] = None,
      prefix: str = "",
      suffix: str = "",
      batch_size: int = 32,
      progress_bar: bool = True,
      normalize_embeddings: bool = False,
  ):
      """
      Create a SentenceTransformersTextEmbedder component.
  
      :param model: Local path or name of the model in Hugging Face's model hub,
          such as ``'sentence-transformers/all-mpnet-base-v2'``.
      :param device: Device (like 'cuda' / 'cpu') that should be used for computation.
          Defaults to CPU.
      :param token: The API token used to download private models from Hugging Face.
          If this parameter is set to `True`, then the token generated when running
          `transformers-cli login` (stored in ~/.huggingface) will be used.
      :param prefix: A string to add to the beginning of each Document text before embedding.
          Can be used to prepend the text with an instruction, as required by some embedding models,
          such as E5 and bge.
      :param suffix: A string to add to the end of each text.
      :param batch_size: Number of strings to encode at once.
      :param progress_bar: If true, displays progress bar during embedding.
      :param normalize_embeddings: If set to true, returned vectors will have length 1.
      """
  
      self.model = model
      # TODO: remove device parameter and use Haystack's device management once migrated
      self.device = device or "cpu"
      self.token = token
      self.prefix = prefix
      self.suffix = suffix
      self.batch_size = batch_size
      self.progress_bar = progress_bar
      self.normalize_embeddings = normalize_embeddings
  
file_path: haystack/haystack/components/embedders/sentence_transformers_text_embedder.py
imports: from typing import List, Optional, Union, Dict, Any
  from haystack import component, default_to_dict
  from haystack.components.embedders.backends.sentence_transformers_backend import _SentenceTransformersEmbeddingBackendFactory
label_desc: Use image node_id 1 to create a new SentenceTransformersTextEmbedder object  with example: obj = SentenceTransformersTextEmbedder(model, device, token, prefix, suffix, batch_size, progress_bar, normalize_embeddings)