Batch embed documents.
(self, texts: List[str])
| 43 | return embedding.cpu().numpy()[0].tolist() |
| 44 | |
| 45 | def embed_documents(self, texts: List[str]) -> List[List[float]]: |
| 46 | """Batch embed documents.""" |
| 47 | from tqdm import tqdm |
| 48 | return [self._embed_single(text) for text in tqdm(texts, desc="Embedding")] |
| 49 | |
| 50 | def embed_query(self, text: str) -> List[float]: |
| 51 | """Embed single query.""" |
no test coverage detected