Huggingface.js documentation

接口:选项

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

接口:选项

属性

billTo

• Optional billTo: string

用于请求的计费账户。

默认情况下,请求费用将从用户的账户中扣除。 请求只能计入用户所属且已订阅 Enterprise Hub 的组织。

定义于

inference/src/types.ts:42


fetch

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

用于替代默认函数的自定义 fetch 函数,例如用于使用代理或编辑请求头。

类型声明

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

参数
名称类型
inputRequestInfo | URL
init?RequestInit
返回

Promise<Response>

定义于

inference/src/types.ts:25


includeCredentials

• Optional includeCredentials: string | boolean

(默认值:“same-origin”)。String | Boolean。用于请求的身份验证凭据。如果该值为字符串,则直接传递。如果为布尔值,true 对应 “include”,false 则完全不发送凭据。

定义于

inference/src/types.ts:34


retry_on_error

• Optional retry_on_error: boolean

(默认值:true)布尔值。如果请求返回 503,则使用相同参数重试该请求。

定义于

inference/src/types.ts:20


signal

• Optional signal: AbortSignal

用于中断请求的 Abort Controller 信号。

定义于

inference/src/types.ts:29

Update on GitHub