@modelpark/huggingface-hub-api
v1.0.9
Published
Huggingface Hub API for Javascript
Downloads
12
Maintainers
Readme
Class: HFHubService
Hierarchy
Service
↳
default
Table of contents
Constructors
Properties
Methods
- CreateRepo
- DeleteRepo
- DeleteRequest
- GetData
- GetDataset
- GetDatasetTagsByType
- GetDatasets
- GetHeaders
- GetMetrics
- GetModel
- GetModelTagsByType
- GetModels
- GetRequest
- GetSpace
- GetSpaces
- MoveRepo
- PatchRequest
- PostRequest
- PutRequest
- UpdateRepoVisibility
- UploadFile
- WhoAmI
- getUri
Constructors
constructor
• new default(accessToken?
, transformHeaders?
, baseUrl?
)
Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| accessToken?
| string
| undefined
|
| transformHeaders
| (headers
: Headers
) => Headers
| undefined
|
| baseUrl
| string
| 'https://huggingface.co/api'
|
Overrides
Service.constructor
Defined in
Properties
accessToken
• Optional
accessToken: string
Inherited from
Service.accessToken
Defined in
baseUrl
• Readonly
baseUrl: string
= 'https://huggingface.co/api'
Inherited from
Service.baseUrl
Defined in
transformHeaders
• transformHeaders: (headers
: Headers
) => Headers
Type declaration
▸ (headers
): Headers
Parameters
| Name | Type |
| :------ | :------ |
| headers
| Headers
|
Returns
Headers
Inherited from
Service.transformHeaders
Defined in
Methods
CreateRepo
▸ CreateRepo(data
): ResponseType
<any
>
Parameters
| Name | Type |
| :------ | :------ |
| data
| any
|
Returns
ResponseType
<any
>
Defined in
DeleteRepo
▸ DeleteRepo(data
): ResponseType
<any
>
Parameters
| Name | Type |
| :------ | :------ |
| data
| any
|
Returns
ResponseType
<any
>
Defined in
DeleteRequest
▸ DeleteRequest(uri
, body
, params?
): Promise
<any
>
Parameters
| Name | Type |
| :------ | :------ |
| uri
| string
|
| body
| any
|
| params?
| Params
|
Returns
Promise
<any
>
Inherited from
Service.DeleteRequest
Defined in
GetData
▸ Protected
GetData(response
): Promise
<{ data
: Promise
<unknown
> ; nextUrl
: undefined
| string
; total
: null
| string
}>
Parameters
| Name | Type |
| :------ | :------ |
| response
| Response
|
Returns
Promise
<{ data
: Promise
<unknown
> ; nextUrl
: undefined
| string
; total
: null
| string
}>
Inherited from
Service.GetData
Defined in
GetDataset
▸ GetDataset(datasetId
, params?
): ResponseType
<Dataset
>
Parameters
| Name | Type |
| :------ | :------ |
| datasetId
| string
|
| params?
| Params
|
Returns
ResponseType
<Dataset
>
Defined in
GetDatasetTagsByType
▸ GetDatasetTagsByType(): ResponseType
<Tag
[]>
Returns
ResponseType
<Tag
[]>
Defined in
GetDatasets
▸ GetDatasets(params?
): ResponseType
<Dataset
[]>
Parameters
| Name | Type |
| :------ | :------ |
| params?
| Params
|
Returns
ResponseType
<Dataset
[]>
Defined in
GetHeaders
▸ Protected
GetHeaders(): Headers
Returns
Headers
Inherited from
Service.GetHeaders
Defined in
GetMetrics
▸ GetMetrics(): ResponseType
<Metric
[]>
Returns
ResponseType
<Metric
[]>
Defined in
GetModel
▸ GetModel(modelId
, params?
): ResponseType
<Model
>
Parameters
| Name | Type |
| :------ | :------ |
| modelId
| string
|
| params?
| Params
|
Returns
ResponseType
<Model
>
Defined in
GetModelTagsByType
▸ GetModelTagsByType(): ResponseType
<Tag
[]>
Returns
ResponseType
<Tag
[]>
Defined in
GetModels
▸ GetModels(params?
): ResponseType
<Model
[]>
Parameters
| Name | Type |
| :------ | :------ |
| params?
| Params
|
Returns
ResponseType
<Model
[]>
Defined in
GetRequest
▸ GetRequest(uri
, params?
): Promise
<any
>
Parameters
| Name | Type |
| :------ | :------ |
| uri
| string
|
| params?
| Params
|
Returns
Promise
<any
>
Inherited from
Service.GetRequest
Defined in
GetSpace
▸ GetSpace(spaceId
, params?
): ResponseType
<Space
>
Parameters
| Name | Type |
| :------ | :------ |
| spaceId
| string
|
| params?
| Params
|
Returns
ResponseType
<Space
>
Defined in
GetSpaces
▸ GetSpaces(params?
): ResponseType
<Space
[]>
Parameters
| Name | Type |
| :------ | :------ |
| params?
| Params
|
Returns
ResponseType
<Space
[]>
Defined in
MoveRepo
▸ MoveRepo(data
): ResponseType
<any
>
Parameters
| Name | Type |
| :------ | :------ |
| data
| any
|
Returns
ResponseType
<any
>
Defined in
PatchRequest
▸ PatchRequest(uri
, body
, params?
): Promise
<any
>
Parameters
| Name | Type |
| :------ | :------ |
| uri
| string
|
| body
| any
|
| params?
| Params
|
Returns
Promise
<any
>
Inherited from
Service.PatchRequest
Defined in
PostRequest
▸ PostRequest(uri
, body
, params?
): Promise
<any
>
Parameters
| Name | Type |
| :------ | :------ |
| uri
| string
|
| body
| any
|
| params?
| Params
|
Returns
Promise
<any
>
Inherited from
Service.PostRequest
Defined in
PutRequest
▸ PutRequest(uri
, body
, params?
): Promise
<any
>
Parameters
| Name | Type |
| :------ | :------ |
| uri
| string
|
| body
| any
|
| params?
| Params
|
Returns
Promise
<any
>
Inherited from
Service.PutRequest
Defined in
UpdateRepoVisibility
▸ UpdateRepoVisibility(type
, repo_id
, data
): ResponseType
<any
>
Parameters
| Name | Type |
| :------ | :------ |
| type
| string
|
| repo_id
| string
|
| data
| Object
|
| data.private
| any
|
Returns
ResponseType
<any
>
Defined in
UploadFile
▸ UploadFile(type
, repo_id
, revision
, path_in_repo
, data
): ResponseType
<any
>
Parameters
| Name | Type |
| :------ | :------ |
| type
| string
|
| repo_id
| string
|
| revision
| any
|
| path_in_repo
| string
|
| data
| any
|
Returns
ResponseType
<any
>
Defined in
WhoAmI
▸ WhoAmI(): ResponseType
<User
>
Returns
ResponseType
<User
>
Defined in
getUri
▸ Protected
getUri(uri
, params?
): string
Parameters
| Name | Type |
| :------ | :------ |
| uri
| string
|
| params
| Params
|
Returns
string
Inherited from
Service.getUri