@huggingface/inference
Version:
Typescript client for the Hugging Face Inference Providers and Inference Endpoints
14 lines (11 loc) • 373 B
text/typescript
import type { BaseArgs, RequestArgs } from "../../types";
import { omit } from "../../utils/omit";
/**
* @deprecated
*/
export interface LegacyImageInput {
data: Blob | ArrayBuffer;
}
export function preparePayload(args: BaseArgs & ({ inputs: Blob } | LegacyImageInput)): RequestArgs {
return "data" in args ? args : { ...omit(args, "inputs"), data: args.inputs };
}