Skip to content

Cleaning up --help: Artifact Management Subcommands #886

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

Merged
merged 5 commits into from
Jul 10, 2024

Conversation

Jack-Khuu
Copy link
Contributor

The current --help is a mess; it uses a giant add_arguments_for_verb function that doesn't actually filter based on the provided verb subcommand.

This PR is part of a series to clean up this behavior.

Specifically, this PR separates out and defines the arg closure for artifact management subcommands (download, list, remove, where). These subcommands are sufficiently different from the other commands, so it makes things cleaner to special case them out.

Note that I was very verbose in listing the conditionals for legibility


python3 torchchat.py download --help

usage: torchchat download [-h] [--model-directory MODEL_DIRECTORY] [--hf-token HF_TOKEN] [model]

positional arguments:
  model                 Model name for well-known models

options:
  -h, --help            show this help message and exit
  --model-directory MODEL_DIRECTORY
                        The directory to store downloaded model artifacts. Default: /Users/jackkhuu/.torchchat/model-cache
  --hf-token HF_TOKEN   A HuggingFace API token to use when downloading model artifacts

python3 torchchat.py list --help

usage: torchchat list [-h] [--model-directory MODEL_DIRECTORY]

options:
  -h, --help            show this help message and exit
  --model-directory MODEL_DIRECTORY
                        The directory to store downloaded model artifacts. Default: /Users/jackkhuu/.torchchat/model-cache

python3 torchchat.py remove --help

usage: torchchat remove [-h] [--model-directory MODEL_DIRECTORY] [model]

positional arguments:
  model                 Model name for well-known models

options:
  -h, --help            show this help message and exit
  --model-directory MODEL_DIRECTORY
                        The directory to store downloaded model artifacts. Default: /Users/jackkhuu/.torchchat/model-cache

python3 torchchat.py where --help

usage: torchchat where [-h] [--model-directory MODEL_DIRECTORY] [model]

positional arguments:
  model                 Model name for well-known models

options:
  -h, --help            show this help message and exit
  --model-directory MODEL_DIRECTORY
                        The directory to store downloaded model artifacts. Default: /Users/jackkhuu/.torchchat/model-cache

Copy link

pytorch-bot bot commented Jul 9, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchchat/886

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 1 Cancelled Job

As of commit 3637065 with merge base b6b6c1e (image):

NEW FAILURE - The following job has failed:

CANCELLED JOB - The following job was cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 9, 2024
@Jack-Khuu Jack-Khuu merged commit 8c7165e into fix-help-eval Jul 10, 2024
49 of 51 checks passed
Jack-Khuu added a commit that referenced this pull request Jul 10, 2024
@Jack-Khuu Jack-Khuu deleted the fix-help-download branch July 10, 2024 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants