kaira.models.ConfigurableModel

Inheritance diagram for ConfigurableModel
- class kaira.models.ConfigurableModel(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelModel that supports dynamically adding and removing steps.
This class extends the basic model functionality with methods to add, remove, and manage model steps during runtime.
Methods
Initialize the configurable model.
Add a processing step to the model.
Process input through all steps sequentially.
Remove a processing step from the model.
- add_step(step: Callable) ConfigurableModel[source]
Add a processing step to the model.
- Parameters:
step – A callable that will be added to the processing pipeline. Must accept and return tensor-like objects.
- Returns:
Self for method chaining
- remove_step(index: int) ConfigurableModel[source]
Remove a processing step from the model.
- Parameters:
index – The index of the step to remove
- Returns:
Self for method chaining
- Raises:
IndexError – If the index is out of range
- forward(input_data: Any, *args: Any, **kwargs: Any) Any[source]
Process input through all steps sequentially.
- Parameters:
input_data (Any) – The input to process
*args (Any) – Positional arguments passed to each step
**kwargs (Any) – Additional keyword arguments passed to each step
- Returns:
The result after applying all steps