@modelpark/huggingface-hub-api
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

Class: HFHubService

Hierarchy

  • Service

    default

Table of contents

Constructors

Properties

Methods

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

index.ts:6

Properties

accessToken

Optional accessToken: string

Inherited from

Service.accessToken

Defined in

index.ts:7


baseUrl

Readonly baseUrl: string = 'https://huggingface.co/api'

Inherited from

Service.baseUrl

Defined in

index.ts:9


transformHeaders

transformHeaders: (headers: Headers) => Headers

Type declaration

▸ (headers): Headers

Parameters
Name Type
headers Headers
Returns

Headers

Inherited from

Service.transformHeaders

Defined in

index.ts:8

Methods

CreateRepo

CreateRepo(data): ResponseType<any>

Parameters

Name Type
data any

Returns

ResponseType<any>

Defined in

index.ts:50


DeleteRepo

DeleteRepo(data): ResponseType<any>

Parameters

Name Type
data any

Returns

ResponseType<any>

Defined in

index.ts:54


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

service.ts:41


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

service.ts:107


GetDataset

GetDataset(datasetId, params?): ResponseType<Dataset>

Parameters

Name Type
datasetId string
params? Params

Returns

ResponseType<Dataset>

Defined in

index.ts:38


GetDatasetTagsByType

GetDatasetTagsByType(): ResponseType<Tag[]>

Returns

ResponseType<Tag[]>

Defined in

index.ts:42


GetDatasets

GetDatasets(params?): ResponseType<Dataset[]>

Parameters

Name Type
params? Params

Returns

ResponseType<Dataset[]>

Defined in

index.ts:34


GetHeaders

Protected GetHeaders(): Headers

Returns

Headers

Inherited from

Service.GetHeaders

Defined in

service.ts:98


GetMetrics

GetMetrics(): ResponseType<Metric[]>

Returns

ResponseType<Metric[]>

Defined in

index.ts:46


GetModel

GetModel(modelId, params?): ResponseType<Model>

Parameters

Name Type
modelId string
params? Params

Returns

ResponseType<Model>

Defined in

index.ts:18


GetModelTagsByType

GetModelTagsByType(): ResponseType<Tag[]>

Returns

ResponseType<Tag[]>

Defined in

index.ts:30


GetModels

GetModels(params?): ResponseType<Model[]>

Parameters

Name Type
params? Params

Returns

ResponseType<Model[]>

Defined in

index.ts:14


GetRequest

GetRequest(uri, params?): Promise<any>

Parameters

Name Type
uri string
params? Params

Returns

Promise<any>

Inherited from

Service.GetRequest

Defined in

service.ts:12


GetSpace

GetSpace(spaceId, params?): ResponseType<Space>

Parameters

Name Type
spaceId string
params? Params

Returns

ResponseType<Space>

Defined in

index.ts:26


GetSpaces

GetSpaces(params?): ResponseType<Space[]>

Parameters

Name Type
params? Params

Returns

ResponseType<Space[]>

Defined in

index.ts:22


MoveRepo

MoveRepo(data): ResponseType<any>

Parameters

Name Type
data any

Returns

ResponseType<any>

Defined in

index.ts:62


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

service.ts:56


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

service.ts:26


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

service.ts:71


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

index.ts:58


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

index.ts:66


WhoAmI

WhoAmI(): ResponseType<User>

Returns

ResponseType<User>

Defined in

index.ts:70


getUri

Protected getUri(uri, params?): string

Parameters

Name Type
uri string
params Params

Returns

string

Inherited from

Service.getUri

Defined in

service.ts:86

Package Sidebar

Install

npm i @modelpark/huggingface-hub-api

Weekly Downloads

2

Version

1.0.9

License

ISC

Unpacked Size

36.1 kB

Total Files

26

Last publish

Collaborators

  • rturan