torch_frame.config.TextEmbedderConfig

class TextEmbedderConfig(text_embedder: Callable[[list[str]], Tensor], batch_size: Optional[int] = None)[source]

Bases: object

Text embedder model that maps a list of strings/sentences into PyTorch Tensor embeddings.

Parameters:
  • text_embedder (callable) – A callable text embedder that takes a list of strings as input and outputs the PyTorch Tensor embeddings for that list of strings.

  • batch_size (int, optional) – Batch size to use when encoding the sentences. If set to None, the text embeddings will be obtained in a full-batch manner. (default: None)