Add ollama embeddings (#1634)
This commit is contained in:
@@ -1,7 +1,21 @@
|
||||
from typing import Optional
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from mem0.configs.embeddings.base import BaseEmbedderConfig
|
||||
|
||||
|
||||
class EmbeddingBase(ABC):
|
||||
def __init__(self, config: Optional[BaseEmbedderConfig] = None):
|
||||
"""Initialize a base LLM class
|
||||
|
||||
:param config: Embedder configuration option class, defaults to None
|
||||
:type config: Optional[BaseEmbedderConfig], optional
|
||||
"""
|
||||
if config is None:
|
||||
self.config = BaseEmbedderConfig()
|
||||
else:
|
||||
self.config = config
|
||||
|
||||
@abstractmethod
|
||||
def embed(self, text):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user