mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-04-29 12:00:00 +00:00
model selector and model suggestions
This commit is contained in:
parent
80353a97c9
commit
9ba5709a3c
8 changed files with 182 additions and 115 deletions
|
|
@ -112,8 +112,6 @@ class ObjectModel(BaseModel):
|
|||
from open_notebook.domain.models import model_manager
|
||||
from open_notebook.models import EmbeddingModel
|
||||
|
||||
EMBEDDING_MODEL: EmbeddingModel = model_manager.embedding_model
|
||||
|
||||
try:
|
||||
self.model_validate(self.model_dump(), strict=True)
|
||||
data = self._prepare_save_data()
|
||||
|
|
@ -122,6 +120,7 @@ class ObjectModel(BaseModel):
|
|||
if self.needs_embedding():
|
||||
embedding_content = self.get_embedding_content()
|
||||
if embedding_content:
|
||||
EMBEDDING_MODEL: EmbeddingModel = model_manager.embedding_model
|
||||
data["embedding"] = EMBEDDING_MODEL.embed(embedding_content)
|
||||
|
||||
if self.id is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue