Skip to main content

resolve_pipe

Decorator that resolves Pipe instances in function arguments. This function wraps a given function and ensures that any Pipe instances in its keyword arguments are instantiated before the function is executed. If a Pipe instance is found, it is replaced with the result of its resolve method. Parameters: Returns: Examples: Here, transform is an instance of Pipe, and before run_pipeline is executed, it is replaced with MyTransformer(arg1, arg2).

Pipe

Wrapper that allows introspection for complex objects. This class provides a way to wrap models and their parameters in a structure that allows easy traversal of nested tuples and dictionaries. It is particularly useful for frameworks that do not support direct introspection of complex objects. Parameters: Examples: Pipe can be used in model configurations to facilitate introspection and parameter naming. For example:
Using this approach ensures that parameter names are structured appropriately, e.g., transform.arg1 and transform.arg2.

Ancestors

  • builtins.tuple

Instance variables

  • model: Type: The model or function to be instantiated with the provided arguments.
  • kwargs: Dict[str, Any]: The keyword arguments to be passed when instantiating model.

Methods

resolve

Instantiate the model with the provided keyword arguments. Returns: