diff --git a/packages/hub/README.md b/packages/hub/README.md index d5ae9298e..e015fc1e5 100644 --- a/packages/hub/README.md +++ b/packages/hub/README.md @@ -28,7 +28,7 @@ Check out the [full documentation](https://huggingface.co/docs/huggingface.js/hu For some of the calls, you need to create an account and generate an [access token](https://huggingface.co/settings/tokens). ```ts -import { createRepo, uploadFiles, deleteFile, deleteRepo, listFiles, whoAmI } from "@huggingface/hub"; +import { createRepo, uploadFiles, uploadFilesWithProgress, deleteFile, deleteRepo, listFiles, whoAmI } from "@huggingface/hub"; import type { RepoDesignation, Credentials } from "@huggingface/hub"; const repo: RepoDesignation = { type: "model", name: "myname/some-model" }; @@ -64,6 +64,18 @@ await uploadFiles({ ], }); +// or + +for await (const progressEvent of await uploadFilesWithProgress({ + repo, + credentials, + files: [ + ... + ], +})) { + console.log(progressEvent); +} + await deleteFile({repo, credentials, path: "myfile.bin"}); await (await downloadFile({ repo, path: "README.md" })).text();