Ƭ AccessToken: `hf_${string}`
Ƭ CommitOperation: CommitDeletedEntry
| CommitFile
Ƭ RepoType: "space"
| "dataset"
| "model"
Ƭ SpaceHardwareFlavor: "cpu-basic"
| "cpu-upgrade"
| "t4-small"
| "t4-medium"
| "a10g-small"
| "a10g-large"
| "a100-large"
Ƭ SpaceSdk: "streamlit"
| "gradio"
| "docker"
| "static"
▸ commit(params
): Promise
<CommitOutput
>
Name | Type |
---|---|
params |
CommitParams |
Promise
<CommitOutput
>
▸ createRepo(params
): Promise
<void
>
Name | Type | Description |
---|---|---|
params |
Object |
- |
params.credentials |
Credentials |
- |
params.files? |
{ content : ArrayBuffer | Blob ; path : string }[] |
Only a few lightweight files are supported at repo creation |
params.hubUrl? |
string |
- |
params.license? |
string |
- |
params.private? |
boolean |
- |
params.repo |
RepoId |
- |
params.sdk? |
SpaceSdk |
Required for when repo.type === “space” |
Promise
<void
>
▸ deleteRepo(params
): Promise
<void
>
Name | Type |
---|---|
params |
Object |
params.credentials |
Credentials |
params.hubUrl? |
string |
params.repo |
RepoId |
Promise
<void
>
▸ downloadFile(params
): Promise
<Response
| null
>
Name | Type | Description |
---|---|---|
params |
Object |
- |
params.credentials? |
Credentials |
- |
params.hubUrl? |
string |
- |
params.path |
string |
- |
params.raw? |
boolean |
If true, will download the raw git file. For example, when calling on a file stored with Git LFS, the pointer file will be downloaded instead. |
params.repo |
RepoId |
- |
params.revision? |
string |
- |
Promise
<Response
| null
>
null when the file doesn’t exist
hub/src/lib/download-file.ts:8
▸ fileDownloadInfo(params
): Promise
<FileDownloadInfoOutput
| null
>
Name | Type | Description |
---|---|---|
params |
Object |
- |
params.credentials? |
Credentials |
- |
params.hubUrl? |
string |
- |
params.noContentDisposition? |
boolean |
To avoid the content-disposition header in the downloadLink for LFS files So that on browsers you can use the URL in an iframe for example |
params.path |
string |
- |
params.raw? |
boolean |
To get the raw pointer file behind a LFS file |
params.repo |
RepoId |
- |
params.revision? |
string |
- |
Promise
<FileDownloadInfoOutput
| null
>
null when the file doesn’t exist
hub/src/lib/file-download-info.ts:16
▸ listFiles(params
): AsyncGenerator
<ListFileEntry
>
List files in a folder. To list ALL files in the directory, call it
with params.recursive set to true
.
Name | Type | Description |
---|---|---|
params |
Object |
- |
params.credentials? |
Credentials |
- |
params.hubUrl? |
string |
- |
params.path? |
string |
Eg ‘data’ for listing all files in the ‘data’ folder. Leave it empty to list all files in the repo. |
params.recursive? |
boolean |
Do we want to list files in subdirectories? |
params.repo |
RepoId |
- |
params.revision? |
string |
- |
AsyncGenerator
<ListFileEntry
>