Skip to content

Commit 92b808b

Browse files
committed
small config bug fix
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
1 parent 885266f commit 92b808b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tensorrt_llm/_torch/auto_deploy/utils/_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def settings_customise_sources(
190190
) -> tuple[PydanticBaseSettingsSource, ...]:
191191
"""Customise settings sources."""
192192
deferred_yaml_settings = DynamicYamlWithDeepMergeSettingsSource(settings_cls)
193+
env_settings.env_prefix = "AD_" # NOTE: set prefix to avoid conflicts with other env vars
193194
return (
194195
init_settings,
195196
env_settings,

tests/unittest/_torch/auto_deploy/unit/singlegpu/utils/test_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def test_env_overrides_yaml(basic_yaml_files):
389389
"""Test that environment variables override yaml configs."""
390390
with patch.dict(
391391
os.environ,
392-
{"SIMPLE": '{"value": 888, "name": "env_value"}', "OPTION": '{"name": "env_option"}'},
392+
{"AD_SIMPLE": '{"value": 888, "name": "env_value"}', "AD_OPTION": '{"name": "env_option"}'},
393393
):
394394
settings = BasicSettings(yaml_extra=[basic_yaml_files["config1"]])
395395

@@ -403,7 +403,7 @@ def test_env_overrides_yaml(basic_yaml_files):
403403

404404
def test_partial_env_override(basic_yaml_files):
405405
"""Test partial environment variable override."""
406-
with patch.dict(os.environ, {"SIMPLE": '{"flag": true}', "OPTION": '{"option": "on"}'}):
406+
with patch.dict(os.environ, {"AD_SIMPLE": '{"flag": true}', "AD_OPTION": '{"option": "on"}'}):
407407
settings = BasicSettings(yaml_extra=[basic_yaml_files["config1"]])
408408

409409
# Mix of env and yaml values

0 commit comments

Comments
 (0)