From 88691aeee6d8c308e3abef6dea9caf3f8e85a5db Mon Sep 17 00:00:00 2001 From: Mickus Timothee Date: Mon, 2 Oct 2023 18:15:57 +0300 Subject: [PATCH] halt and catch fire for unknown args --- mammoth/utils/parse.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mammoth/utils/parse.py b/mammoth/utils/parse.py index 54056cf9..54a485c3 100644 --- a/mammoth/utils/parse.py +++ b/mammoth/utils/parse.py @@ -269,6 +269,12 @@ def defaults(cls, *args): defaults = dummy_parser.parse_known_args([])[0] return defaults + def parse_known_args(self): + opts, unknown = super().parse_known_args() + if unknown: + raise ValueError(f'unknown arguments provided:\n{unknown}') + return opts, unknown + @classmethod def update_model_opts(cls, model_opts): cls._validate_adapters(model_opts)