LoadTrainingDatasetUnit
Load the dataset a model was trained on, under a key of its own.
Deliberately not LoadDatasetUnit: this dataset is not the one being
transformed, it is a reference the prediction needs — the task decodes
predicted class indexes against its labels, and its declared types become
the schema of the saved result. Publishing it as dataset would collide
with the dataset actually being predicted on, since PROVIDES is fixed
per class and both would want the same key.
Two outputs, with different rules on purpose: the live dataset is cached for the prediction step, while the types travel as a plain JSON-serializable mapping so the saving step never has to reopen the file. Nothing derived from the dataset being predicted on crosses this boundary.
Methods
execute(self, ctx: DashAI.back.units.context.ExecutionContext) -> None
LoadTrainingDatasetUnitDo the unit's work, reading from and writing to the context.
Parameters
- ctx : ExecutionContext
- The shared execution context.
get_credential(self, name: str)
ConfigObjectResolve a registered credential component by name.
Parameters
- name : str
- Credential component class name (e.g. "HuggingFaceCredential").
Returns
- BaseCredential
- An instance of the requested credential component.
get_schema(cls) -> dict
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
validate(self, ctx: DashAI.back.units.context.ExecutionContext) -> None
BaseUnitCheck preconditions without executing the unit.
Parameters
- ctx : ExecutionContext
- The shared execution context.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.
Parameters
- raw_data : dict
- A dictionary with the data provided by the user to initialize the model.
Returns
- dict
- A validated dictionary with the necessary objects.