diff --git a/CHANGELOG.md b/CHANGELOG.md index 49c47b1e3..01acf553a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix existing templates - Add optional data insert to `Table` - Make Lance vector searcher as plugin. +- Remove job dependencies from job metadata #### New Features & Functionality @@ -77,6 +78,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated llm_finetuning template - Add sql table length exceed limit and uuid truncation. - Add ci workflow to test templates +- Add deploy flag in model. #### Bug Fixes diff --git a/superduper/base/event.py b/superduper/base/event.py index dd95fe2b9..f52552e4e 100644 --- a/superduper/base/event.py +++ b/superduper/base/event.py @@ -17,6 +17,7 @@ def dict(self): _base_dict = dc.asdict(self) if 'time' in _base_dict: _base_dict['time'] = str(_base_dict['time']) + _base_dict.pop('dependencies', None) return { **_base_dict, 'genus': self.genus, diff --git a/superduper/components/component.py b/superduper/components/component.py index a80062b06..3c958a416 100644 --- a/superduper/components/component.py +++ b/superduper/components/component.py @@ -559,7 +559,6 @@ def declare_component(self, cluster): if self.cache: logging.info(f'Adding {self.type_id}: {self.identifier} to cache') cluster.cache.put(self) - cluster.compute.put(self) def on_load(self, db: Datalayer) -> None: """Called when this component is loaded from the data store. diff --git a/superduper/components/model.py b/superduper/components/model.py index aa68be068..0c8fc96d5 100644 --- a/superduper/components/model.py +++ b/superduper/components/model.py @@ -372,6 +372,7 @@ class Model(Component, metaclass=ModelMeta): ``compute_kwargs`` on a distributed cluster. :param trainer: `Trainer` instance to use for training. :param example: An example to auto-determine the schema/ datatype. + :param deploy: Creates a standalone class instance on compute cluster. """ type_id: t.ClassVar[str] = 'model' @@ -387,6 +388,7 @@ class Model(Component, metaclass=ModelMeta): serve: bool = False trainer: t.Optional[Trainer] = None example: dc.InitVar[t.Any | None] = None + deploy: bool = False def __post_init__(self, db, artifacts, example): super().__post_init__(db, artifacts) @@ -407,7 +409,9 @@ def _wrapper(self, data): def declare_component(self, cluster): """Declare model on compute.""" - cluster.compute.put(self) + super().declare_component(cluster) + if self.deploy or self.serve: + cluster.compute.put(self) @abstractmethod def predict(self, *args, **kwargs) -> t.Any: