Skip to content

Commit 0255f71

Browse files
authored
(bugfix)(torchx/runner) properly remove TORCHX_ prefix from env var before setting scheduler_params
Differential Revision: D79473894 Pull Request resolved: #1094
1 parent ae55901 commit 0255f71

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

torchx/runner/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ def __init__(
129129
def _get_scheduler_params_from_env(self) -> Dict[str, str]:
130130
scheduler_params = {}
131131
for key, value in os.environ.items():
132-
lower_case_key = key.lower()
133-
if lower_case_key.startswith("torchx_"):
134-
scheduler_params[lower_case_key.strip("torchx_")] = value
132+
key = key.lower()
133+
if key.startswith("torchx_"):
134+
scheduler_params[key.removeprefix("torchx_")] = value
135135
return scheduler_params
136136

137137
def __enter__(self) -> "Self":

0 commit comments

Comments
 (0)