Download api/core/rag/embedding/embedding_base.py from ZHZ1024/dify: direct link, hf CLI and curl.
- Browser
- Download file 699 Bytes
-
https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/api/core/rag/embedding/embedding_base.py
- Command line
-
hf download hf://spaces/ZHZ1024/dify/api/core/rag/embedding/embedding_base.py
-
curl -L -o embedding_base.py https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/api/core/rag/embedding/embedding_base.py
699 Bytes
| from abc import ABC, abstractmethod | |
| class Embeddings(ABC): | |
| """Interface for embedding models.""" | |
| def embed_documents(self, texts: list[str]) -> list[list[float]]: | |
| """Embed search docs.""" | |
| raise NotImplementedError | |
| def embed_query(self, text: str) -> list[float]: | |
| """Embed query text.""" | |
| raise NotImplementedError | |
| async def aembed_documents(self, texts: list[str]) -> list[list[float]]: | |
| """Asynchronous Embed search docs.""" | |
| raise NotImplementedError | |
| async def aembed_query(self, text: str) -> list[float]: | |
| """Asynchronous Embed query text.""" | |
| raise NotImplementedError | |