Skip to content

Commit

Permalink
Remove token arg from CLI examples (#6839)
Browse files Browse the repository at this point in the history
* Remove token arg from CLI example

* Add tip suggesting logging in first

* Update help message for token arg

* Add leading >>> to bash command
  • Loading branch information
albertvillanova authored Apr 26, 2024
1 parent fe2bea6 commit 22bf538
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions docs/source/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ positional arguments:

optional arguments:
-h, --help show this help message and exit
--token TOKEN access token to the Hugging Face Hub
--token TOKEN access token to the Hugging Face Hub (defaults to logged-in user's one)
--revision REVISION source revision
--trust_remote_code whether to trust the code execution of the load script
```
Expand All @@ -49,5 +49,14 @@ Note that you should pass the `--trust_remote_code` argument only if you trust t
For example:
```bash
>>> datasets-cli convert_to_parquet USERNAME/DATASET_NAME --token USER_ACCESS_TOKEN
>>> datasets-cli convert_to_parquet USERNAME/DATASET_NAME
```
<Tip>
Do not forget that you need to log in first to your Hugging Face account:
```bash
>>> huggingface-cli login
```
</Tip>
2 changes: 1 addition & 1 deletion src/datasets/commands/convert_to_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def register_subcommand(parser):
parser.add_argument(
"dataset_id", help="source dataset ID, e.g. USERNAME/DATASET_NAME or ORGANIZATION/DATASET_NAME"
)
parser.add_argument("--token", help="access token to the Hugging Face Hub")
parser.add_argument("--token", help="access token to the Hugging Face Hub (defaults to logged-in user's one)")
parser.add_argument("--revision", help="source revision")
parser.add_argument(
"--trust_remote_code", action="store_true", help="whether to trust the code execution of the load script"
Expand Down

0 comments on commit 22bf538

Please sign in to comment.