Skip to main content

parse_response

Function parse_response 

Source
pub fn parse_response(
    task: Task,
    kind: BackendKind,
    raw: InferenceOutputs,
    labels: Option<&[String]>,
) -> Result<InferenceOutputs, AdapterError>
Expand description

Resolve a raw provider response into the task’s per-row output column.

labels carries the candidate/intrinsic label set for classification — the model’s id2label for a local classifier (required), ignored otherwise.

§Errors

Returns AdapterError if the output shape is wrong for the task, a local classifier has no labels or argmaxes out of range, or the task cannot run on the given backend kind.