class_docstr: Wrapper around bigdl-llm transformers embedding models.
  
  To use, you should have the ``transformers`` python package installed.
  
  Example:
      .. code-block:: python
  
          from bigdl.llm.langchain.embeddings import TransformersEmbeddings
          embeddings = TransformersEmbeddings.from_model_id(model_id)
class_docstr_tok: ["Wrapper","around","bigdl-llm","transformers","embedding","models",".","To","use",",","you","should","have","the","``","transformers","``","python","package","installed",".","Example",":","..","code-block",":",":","python","from","bigdl.llm.langchain.embeddings","import","TransformersEmbeddings","embeddings","=","TransformersEmbeddings.from_model_id","(","model_id",")"]
docstr: Compute doc embeddings using a HuggingFace transformer model.
  
  Args:
      texts: The list of texts to embed.
  
  Returns:
      List of embeddings, one for each text.
docstr_tok: ["Compute","doc","embeddings","using","a","HuggingFace","transformer","model",".","Args",":","texts",":","The","list","of","texts","to","embed",".","Returns",":","List","of","embeddings",",","one","for","each","text","."]
code: def embed_documents(self, texts: List[str]) -> List[List[float]]:
      """Compute doc embeddings using a HuggingFace transformer model.
  
      Args:
          texts: The list of texts to embed.
  
      Returns:
          List of embeddings, one for each text.
      """
      texts = list(map(lambda x: x.replace("\n", " "), texts))
      embeddings = [
          self.embed(text, **self.encode_kwargs).tolist()
          for text in texts
      ]
      return embeddings
  
file_path: BigDL/python/llm/src/bigdl/llm/langchain/embeddings/transformersembeddings.py
imports: from typing import Any, Dict, List, Optional
  import numpy
  from pydantic import BaseModel, Extra, Field
  from langchain.embeddings.base import Embeddings
label_desc: Use image node_id 3 for calling the TransformersEmbeddings obj's underlying member method code with example usage: obj.embed_documents(texts) and returns: embeddings