Spaces:
Running
Running
Download openmark/embeddings/base.py from codingwithadi/OpenMark: direct link, hf CLI and curl.
- Browser
- Download file 582 Bytes
-
https://huggingface.co/spaces/codingwithadi/OpenMark/resolve/main/openmark/embeddings/base.py
- Command line
-
hf download hf://spaces/codingwithadi/OpenMark/openmark/embeddings/base.py
-
curl -L -o base.py https://huggingface.co/spaces/codingwithadi/OpenMark/resolve/main/openmark/embeddings/base.py
582 Bytes
| from abc import ABC, abstractmethod | |
| class EmbeddingProvider(ABC): | |
| """Abstract base — swap local pplx-embed or Azure without changing any other code.""" | |
| def embed_documents(self, texts: list[str]) -> list[list[float]]: | |
| """Embed a list of document strings.""" | |
| ... | |
| def embed_query(self, text: str) -> list[float]: | |
| """Embed a single query string.""" | |
| ... | |
| def dimension(self) -> int: | |
| """Output embedding dimension.""" | |
| ... | |