mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
User argpars utils to show default args on command line
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user