mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
This commit is contained in:
parent
290922858f
commit
b341bf5ea1
5 changed files with 39 additions and 31 deletions
|
|
@ -7,8 +7,6 @@ Input is text, output is embeddings vector.
|
|||
import logging
|
||||
from ... base import EmbeddingsService
|
||||
|
||||
from langchain_huggingface import HuggingFaceEmbeddings
|
||||
|
||||
# Module logger
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -38,6 +36,7 @@ class Processor(EmbeddingsService):
|
|||
def _load_model(self, model_name):
|
||||
"""Load a model, caching it for reuse"""
|
||||
if self.cached_model_name != model_name:
|
||||
from langchain_huggingface import HuggingFaceEmbeddings
|
||||
logger.info(f"Loading HuggingFace embeddings model: {model_name}")
|
||||
self.embeddings = HuggingFaceEmbeddings(model_name=model_name)
|
||||
self.cached_model_name = model_name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue