Skip to content
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

🚜 Use field in dataclasses #2494

Merged
merged 39 commits into from
Jan 6, 2025
Merged

🚜 Use field in dataclasses #2494

merged 39 commits into from
Jan 6, 2025

Conversation

qgallouedec
Copy link
Member

@qgallouedec qgallouedec commented Dec 17, 2024

Use fields to enhance the rendering of help.

Aligned with transformers.TrainingArguments, see here

Before:

$ python examples/datasets/hh-rlhf-helpful-base.py --help
usage: hh-rlhf-helpful-base.py [-h] [--push_to_hub [PUSH_TO_HUB]] [--repo_id REPO_ID]
                               [--dataset_num_proc DATASET_NUM_PROC]

options:
  -h, --help            show this help message and exit
  --push_to_hub [PUSH_TO_HUB]
  --repo_id REPO_ID
  --dataset_num_proc DATASET_NUM_PROC

After:

$ python examples/datasets/hh-rlhf-helpful-base.py --help
usage: hh-rlhf-helpful-base.py [-h] [--push_to_hub [PUSH_TO_HUB]] [--repo_id REPO_ID]
                               [--dataset_num_proc DATASET_NUM_PROC]

options:
  -h, --help            show this help message and exit
  --push_to_hub [PUSH_TO_HUB]
                        Whether to push the dataset to the Hugging Face Hub. (default: False)
  --repo_id REPO_ID     Hugging Face repository ID to push the dataset to. (default: trl-lib/hh-rlhf-helpful-base)
  --dataset_num_proc DATASET_NUM_PROC
                        Number of workers to use for dataset processing. (default: None)

Other minor changes:

  1. Whether or not -> Whether

  2. Although equivalent, the later is clearer:

    - my_args (`Optional[int]`, *optional*, defaults to `None`):
    + my_args (`int` or `None`, *optional*, defaults to `None`):

@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.

@qgallouedec qgallouedec marked this pull request as ready for review December 21, 2024 14:02
@qgallouedec qgallouedec requested review from lewtun and kashif and removed request for lewtun December 21, 2024 14:02
@qgallouedec qgallouedec merged commit 52d2131 into main Jan 6, 2025
14 checks passed
@qgallouedec qgallouedec deleted the field branch January 6, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants