Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

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

@pytorch-bot
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

4 participants