Saltar al contenido principal

BuildManualInputUnit

Unit
DashAI.back.units.BuildManualInputUnit

Build the dataset to predict on from values the user typed in.

The counterpart of loading one from disk: it produces the same dataset key, so whatever runs next cannot tell the two apart. That is what lets the prediction step be written once for both sources.

The task does the work — it is the task that knows the expected column types and how to turn an uploaded file into a cell — so this unit only resolves it and hands over the rows.

Parameters​

task_name : string, default=TabularClassificationTask
Name of the task that validates and types the hand-typed rows.
manual_input_data : array, default=[]
Rows to predict on, each a mapping from input column name to value. Uploaded files arrive as a path reference instead of bytes.

Methods​

execute(self, ctx: DashAI.back.units.context.ExecutionContext) -> None

Defined on BuildManualInputUnit

Do the unit's work, reading from and writing to the context.

Parameters

ctx : ExecutionContext
The shared execution context.

validate(self, ctx: DashAI.back.units.context.ExecutionContext) -> None

Defined on BuildManualInputUnit

Resolve the task before anything observable happens.

get_credential(self, name: str)

Defined on ConfigObject

Resolve 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

Defined on ConfigObject

Generates the component related Json Schema.

Returns

dict
Dictionary representing the Json Schema of the component.

validate_and_transform(self, raw_data: dict) -> dict

Defined on ConfigObject

It 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.