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

Map a raw provider response to the task’s per-row output.

labels is the candidate/intrinsic label set for classification; required for local classifiers, ignored otherwise.

§Errors

Returns AdapterError if the output shape is wrong, a local classifier has no labels or an out-of-range argmax, or the task/backend combination is unsupported.