Skip to content

Conversation

coyotte508
Copy link
Member

@coyotte508 coyotte508 commented Apr 29, 2025

If we want to expose a CLI for the JS client...

cc @Pierrci for viz

@coyotte508 coyotte508 added the hub @huggingface/hub related label Apr 29, 2025
@HuggingFaceDocBuilderDev

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;
Copy link
Member Author

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)

@coyotte508 coyotte508 marked this pull request as ready for review April 29, 2025 16:35
@coyotte508
Copy link
Member Author

test failings unrelated to this PR, tests added in this PR pass

@coyotte508 coyotte508 merged commit 21b48fa into main Apr 30, 2025
3 of 6 checks passed
@coyotte508 coyotte508 deleted the upload-folder branch April 30, 2025 11:32
Deep-unlearning pushed a commit that referenced this pull request May 13, 2025
If we want to expose a CLI for the JS client...

cc @Pierrci for viz
coyotte508 added a commit that referenced this pull request May 19, 2025
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hub @huggingface/hub related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants