Spaces:
Running
Running
File size: 715 Bytes
640b1c8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# src/embeddings/base_embedding.py
from abc import ABC, abstractmethod
from typing import List, Union
class BaseEmbedding(ABC):
@abstractmethod
def embed_documents(self, texts: List[str]) -> List[List[float]]:
"""
Embed a list of documents
Args:
texts (List[str]): List of texts to embed
Returns:
List[List[float]]: List of embeddings
"""
pass
@abstractmethod
def embed_query(self, text: str) -> List[float]:
"""
Embed a single query
Args:
text (str): Text to embed
Returns:
List[float]: Embedding vector
"""
pass |