diff --git a/python/morpheus/morpheus/config.py b/python/morpheus/morpheus/config.py index 889ec14757..cce03bb750 100644 --- a/python/morpheus/morpheus/config.py +++ b/python/morpheus/morpheus/config.py @@ -241,7 +241,9 @@ def model_max_batch_size(self, value: int): def _validate_config(self): if self._pipeline_batch_size < self._model_max_batch_size: - warnings.warn("Config has `pipeline_batch_size < model_max_batch_size` which effectively limits `model_max_batch_size`. This may reduce performance.") + warnings.warn( + "Config has `pipeline_batch_size < model_max_batch_size` which effectively limits `model_max_batch_size`. This may reduce performance." + ) def save(self, filename: str): """ diff --git a/tests/test_config.py b/tests/test_config.py index 0d50e1a96d..232d1d35e7 100755 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -17,6 +17,7 @@ import json import os from unittest import mock + import pytest import morpheus @@ -106,12 +107,14 @@ def test_to_string(config): assert isinstance(conf_str, str) assert isinstance(json.loads(conf_str), dict) + def test_warning_model_batch_size_less_than_pipeline_batch_size(): config = morpheus.config.Config() config.pipeline_batch_size = 256 with pytest.warns(): config.model_max_batch_size = 257 + def test_warning_pipeline_batch_size_less_than_model_batch_size(): config = morpheus.config.Config() config.model_max_batch_size = 8