Team Ai
Apppublic

Underground-Digital/Workflow-Engine

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
embedding_base.py24 linesDownload Raw Back to embedding
1from abc import ABC, abstractmethod2 3 4class Embeddings(ABC):5    """Interface for embedding models."""6 7    @abstractmethod8    def embed_documents(self, texts: list[str]) -> list[list[float]]:9        """Embed search docs."""10        raise NotImplementedError11 12    @abstractmethod13    def embed_query(self, text: str) -> list[float]:14        """Embed query text."""15        raise NotImplementedError16 17    async def aembed_documents(self, texts: list[str]) -> list[list[float]]:18        """Asynchronous Embed search docs."""19        raise NotImplementedError20 21    async def aembed_query(self, text: str) -> list[float]:22        """Asynchronous Embed query text."""23        raise NotImplementedError24