From 97bce961114fe0f782acf8099bcc8e8d9f613c6a Mon Sep 17 00:00:00 2001 From: ChanderG Date: Mon, 16 Dec 2024 12:57:47 +0530 Subject: [PATCH] feat: exit on unknown args Signed-off-by: ChanderG --- tuning/sft_trainer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tuning/sft_trainer.py b/tuning/sft_trainer.py index dc3e3733e..7c03931a4 100644 --- a/tuning/sft_trainer.py +++ b/tuning/sft_trainer.py @@ -516,11 +516,14 @@ def parse_arguments(parser, json_config=None): fusedops_kernels_config, attention_and_distributed_packing_config, additional, - _, + leftover, ) = parser.parse_args_into_dataclasses(return_remaining_strings=True) peft_method = additional.peft_method exp_metadata = additional.exp_metadata + if leftover: + logging.error("Extra un-recognized arguments found: %s", leftover) + sys.exit(USER_ERROR_EXIT_CODE) if peft_method == "lora": tune_config = lora_config