pipeline.objects.decorators.pipeline_model( model_class: Any = None )
pipeline_model decorator is used on classes to allow the
Pipeline context manager to treat them as model objects. A model can contain
pipeline_function decorated functions and allows for persistent logic to be present inside of the wrapped class (for caching etc).
Any, optional) - The model class to be wrapped, this is implicitly passed in you do not manually pass this.
from pipeline import Pipeline, pipeline_model ... @pipeline_model class MyModel: def __init__(self, ...): ... ... with Pipeline("example-model") as builder: ... my_model = MyModel() ...
Updated 10 months ago