User argpars utils to show default args on command line

This commit is contained in:
rasbt
2026-03-01 20:15:21 -06:00
parent c079904491
commit 4612d20fa8
27 changed files with 30 additions and 30 deletions

View File

@@ -253,16 +253,16 @@ def main(gpt_config, input_prompt, model_size, device):
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate text with a pretrained GPT-2 model.")
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, description="Generate text with a pretrained GPT-2 model.")
parser.add_argument(
"--prompt",
default="Every effort moves you",
help="Prompt text used to seed the generation (default matches the script's built-in prompt)."
help="Prompt text used to seed the generation."
)
parser.add_argument(
"--device",
default="cpu",
help="Device for running inference, e.g., cpu, cuda, mps, or auto. Defaults to cpu."
help="Device for running inference, e.g., cpu, cuda, mps, or auto."
)
args = parser.parse_args()