Huggingface.js documentation

Interface: Options

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Interface: Options

Properties

fetch

Optional fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise\<Response>

Custom fetch function to use instead of the default one, for example to use a proxy or edit headers.

Type declaration

▸ (input, init?): Promise\<Response>

Parameters
Name Type
input RequestInfo | URL
init? RequestInit
Returns

Promise\<Response>

Defined in

inference/src/types.ts:17


includeCredentials

Optional includeCredentials: string | boolean

(Default: “same-origin”). String | Boolean. Credentials to use for the request. If this is a string, it will be passed straight on. If it’s a boolean, true will be “include” and false will not send credentials at all.

Defined in

inference/src/types.ts:26


retry _ on _ error

Optional retry_on_error: boolean

(Default: true) Boolean. If a request 503s, the request will be retried with the same parameters.

Defined in

inference/src/types.ts:12


signal

Optional signal: AbortSignal

Abort Controller signal to use for request interruption.

Defined in

inference/src/types.ts:21

< > Update on GitHub