From f942de70990a019f6bca175dbdd4fc4af056cc03 Mon Sep 17 00:00:00 2001 From: Farzad Abdolhosseini Date: Mon, 23 Sep 2024 09:55:54 -0700 Subject: [PATCH 1/4] Create test for config_base.py --- ultravox/training/config_base_test.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ultravox/training/config_base_test.py diff --git a/ultravox/training/config_base_test.py b/ultravox/training/config_base_test.py new file mode 100644 index 00000000..a587790d --- /dev/null +++ b/ultravox/training/config_base_test.py @@ -0,0 +1,5 @@ +from ultravox.training import config_base + +def test_can_create_train_config(): + args = config_base.get_train_args() + assert isinstance(args, config_base.TrainConfig) From 1a6519735691ff24a9670c56d278ed0198eb9210 Mon Sep 17 00:00:00 2001 From: Farzad Abdolhosseini Date: Mon, 23 Sep 2024 10:52:12 -0700 Subject: [PATCH 2/4] formatting --- ultravox/training/config_base_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ultravox/training/config_base_test.py b/ultravox/training/config_base_test.py index a587790d..7733cb79 100644 --- a/ultravox/training/config_base_test.py +++ b/ultravox/training/config_base_test.py @@ -1,5 +1,6 @@ from ultravox.training import config_base + def test_can_create_train_config(): args = config_base.get_train_args() assert isinstance(args, config_base.TrainConfig) From f78d3e6f55593a1c831d9cb41d16b2b0778e237f Mon Sep 17 00:00:00 2001 From: Farzad Abdolhosseini Date: Mon, 23 Sep 2024 11:05:27 -0700 Subject: [PATCH 3/4] use empty args to avoid using pytest arguments --- ultravox/training/config_base.py | 2 +- ultravox/training/config_base_test.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ultravox/training/config_base.py b/ultravox/training/config_base.py index cfe2dc47..9ba67054 100644 --- a/ultravox/training/config_base.py +++ b/ultravox/training/config_base.py @@ -167,7 +167,7 @@ def get_train_args(override_sys_args: Optional[List[str]] = None) -> TrainConfig override_sys_args: The command line arguments. If None, sys.argv[1:] is used. This is mainly useful for testing. """ - args = override_sys_args or sys.argv[1:] + args = sys.argv[1:] if override_sys_args is None else override_sys_args return simple_parsing.parse( config_class=TrainConfig, diff --git a/ultravox/training/config_base_test.py b/ultravox/training/config_base_test.py index 7733cb79..2cf9d4a1 100644 --- a/ultravox/training/config_base_test.py +++ b/ultravox/training/config_base_test.py @@ -2,5 +2,6 @@ def test_can_create_train_config(): - args = config_base.get_train_args() + # override args so we don't have to pass in pytest arguments + args = config_base.get_train_args([]) assert isinstance(args, config_base.TrainConfig) From d4284fc5de65b4d7a102d64ccb9ee0a0977400b1 Mon Sep 17 00:00:00 2001 From: Farzad Abdolhosseini Date: Mon, 23 Sep 2024 11:16:57 -0700 Subject: [PATCH 4/4] Update config_base_test.py --- ultravox/training/config_base_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultravox/training/config_base_test.py b/ultravox/training/config_base_test.py index 2cf9d4a1..d5481574 100644 --- a/ultravox/training/config_base_test.py +++ b/ultravox/training/config_base_test.py @@ -2,6 +2,6 @@ def test_can_create_train_config(): - # override args so we don't have to pass in pytest arguments + # override args to [], otherwise pytest arguments will be used args = config_base.get_train_args([]) assert isinstance(args, config_base.TrainConfig)