Huggingface.js 文档

接口:选项

Hugging Face's logo
加入 Hugging Face 社区

并获取增强的文档体验

开始使用

接口:选项

属性

billTo

可选 billTo: string

用于请求的账单账户。

默认情况下,请求记在用户的账户上。请求只能记在用户所属的、且已订阅 Enterprise Hub 的组织账户上。

定义于

inference/src/types.ts:34


fetch

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

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

类型声明

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

参数
名称 类型
input URL | RequestInfo
init? RequestInit
返回值

Promise\<Response>

定义于

inference/src/types.ts:17


includeCredentials

可选 includeCredentials: string | boolean

(默认值:“same-origin”)。字符串 | 布尔值。用于请求的凭据。如果这是一个字符串,它将直接传递。如果它是一个布尔值,true 将是“include”,false 将根本不发送凭据。

定义于

inference/src/types.ts:26


retry _ on _ error

可选 retry_on_error: boolean

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

定义于

inference/src/types.ts:12


signal

可选 signal: AbortSignal

中止控制器信号,用于请求中断。

定义于

inference/src/types.ts:21

< > 在 GitHub 上更新