File tree 3 files changed +29
-1
lines changed
3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,32 @@ for await (const fileInfo of hub.listFiles({repo})) {
93
93
await hub .deleteRepo ({ repo , accessToken: " hf_..." });
94
94
```
95
95
96
+ ## CLI usage
97
+
98
+ You can use ` @huggingface/hub ` in CLI mode to upload files and folders to your repo.
99
+
100
+ ``` console
101
+ npx @huggingface/hub upload coyotte508/test-model .
102
+ npx @huggingface/hub upload datasets/coyotte508/test-dataset .
103
+ # Same thing
104
+ npx @huggingface/hub upload --repo-type dataset coyotte508/test-dataset .
105
+ # Upload new data with 0 history in a separate branch
106
+ npx @huggingface/hub upload coyotte508/test-model . --revision release --empty
107
+
108
+ npx @huggingface/hub --help
109
+ npx @huggingface/hub upload --help
110
+ ```
111
+
112
+ You can also instal globally with ` npm install -g @huggingface/hub ` . Then you can do:
113
+
114
+ ``` console
115
+ hfx upload coyotte508/test-model .
116
+ hfx upload --repo-type dataset coyotte508/test-dataset . --revision release --empty
117
+
118
+ hfx --help
119
+ hfx upload --help
120
+ ```
121
+
96
122
## OAuth Login
97
123
98
124
It's possible to login using OAuth ([ "Sign in with HF"] ( https://huggingface.co/docs/hub/oauth ) ).
Original file line number Diff line number Diff line change 58
58
" face"
59
59
],
60
60
"bin" : {
61
- "@huggingface/hub " : " ./dist/cli.js"
61
+ "hfx " : " ./dist/cli.js"
62
62
},
63
63
"author" : " Hugging Face" ,
64
64
"license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ export async function createBranch(params: {
23
23
empty ?: boolean ;
24
24
/**
25
25
* Use this to overwrite the branch if it already exists.
26
+ *
27
+ * If you only specify `overwrite` and no `revision`/`empty`, and the branch already exists, it will be a no-op.
26
28
*/
27
29
overwrite ?: boolean ;
28
30
} ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments