-
Notifications
You must be signed in to change notification settings - Fork 529
handle folders in uploadFiles #1398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
* | ||
* @default 5 | ||
*/ | ||
maxFolderDepth?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huggingface_hub
uses glob
cc @Wauplin @hanouticelina
Unfortunately support is only experimental for nodejs: https://nodejs.org/api/fs.html#fspromisesglobpattern-options
So using a maxFolderDepth
(to avoid potential symlink recursions)
test failings unrelated to this PR, tests added in this PR pass |
If we want to expose a CLI for the JS client... cc @Pierrci for viz
cc @Wauplin @hanouticelina for viz Internal context: https://huggingface.slack.com/archives/C0256NXF0A2/p1745930278721439?thread_ts=1741697907.530409&cid=C0256NXF0A2 Also add `createBranch` and `deleteBranch` functions Follow up to #1398 eg: ```console npm install -g @huggingface/hub export HF_TOKEN=... # Upload current dir to coyotte508/test-model in a new empty "build" branch hfjs create-branch coyotte508/test-model build --empty hfjs upload coyotte508/test-model --revision build ``` ## Testing go into `packages/hub` run `pnpm install` and run `sudo npm link` - then you can use `hfjs` or just do `node dist/cli.js upload ...` --------- Co-authored-by: Julien Chaumond <[email protected]>
If we want to expose a CLI for the JS client...
cc @Pierrci for viz