You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/en/guides/cli.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -261,6 +261,46 @@ A `.cache/huggingface/` folder is created at the root of your local directory co
261
261
fuyu/model-00001-of-00002.safetensors
262
262
```
263
263
264
+
### Dry-run mode
265
+
266
+
In some cases, you would like to check which files would be downloaded before actually downloading them. You can check this using the `--dry-run` parameter. It lists all files to download on the repo and checks whether they are already downloaded or not. This gives an idea of how many files have to be downloaded and their sizes.
For more details, check out the [download guide](./download.md#dry-run-mode).
303
+
264
304
### Specify cache directory
265
305
266
306
If not using `--local-dir`, all files will be downloaded by default to the cache directory defined by the `HF_HOME`[environment variable](../package_reference/environment_variables#hfhome). You can specify a custom cache using `--cache-dir`:
For more details about the CLI download command, please refer to the [CLI guide](./cli#hf-download).
160
160
161
+
## Dry-run mode
162
+
163
+
In some cases, you would like to check which files would be downloaded before actually downloading them. You can check this using the `--dry-run` parameter. It lists all files to download on the repo and checks whether they are already downloaded or not. This gives an idea of how many files have to be downloaded and their sizes.
[dry-run] Will download 0 files (out of 11) totalling 0.0.
227
+
File Bytes to download
228
+
---------------------------- -----------------
229
+
config.json -
230
+
generation_config.json -
231
+
onnx/config.json -
232
+
onnx/generation_config.json -
233
+
onnx/special_tokens_map.json -
234
+
onnx/tokenizer.json -
235
+
onnx/tokenizer_config.json -
236
+
onnx/vocab.json -
237
+
tokenizer.json -
238
+
tokenizer_config.json -
239
+
vocab.json -
240
+
```
241
+
242
+
Finally, you can also make a dry-run programmatically by passing `dry_run=True` to [`hf_hub_download`] and [`snapshot_download`]. It will return a [`DryRunFileInfo`] (respectively a list of [`DryRunFileInfo`]) with for each file, their commit hash, file name and file size, whether the file is cached and whether the file would be downloaded. In practice, the file will be downloaded if not cached or if `force_download=True` is passed.
243
+
161
244
## Faster downloads
162
245
163
246
There are two options to speed up downloads. Both involve installing a Python package written in Rust.
0 commit comments