mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-27 09:26:22 +02:00
Dynamic embeddings model (#556)
* Dynamic embeddings model selection * Added tests * HF embeddings are skipped, tests don't run with that package currently tests
This commit is contained in:
parent
6129bb68c1
commit
d9d4c91363
8 changed files with 816 additions and 11 deletions
|
|
@ -28,12 +28,14 @@ class Processor(EmbeddingsService):
|
|||
)
|
||||
|
||||
self.client = Client(host=ollama)
|
||||
self.model = model
|
||||
self.default_model = model
|
||||
|
||||
async def on_embeddings(self, text):
|
||||
async def on_embeddings(self, text, model=None):
|
||||
|
||||
use_model = model or self.default_model
|
||||
|
||||
embeds = self.client.embed(
|
||||
model = self.model,
|
||||
model = use_model,
|
||||
input = text
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue