Skip to content

Commit 0e78ad3

Browse files
committed
Fix bug on inputs for jobs.
1 parent 919349c commit 0e78ad3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ads/jobs/builders/infrastructure/dsc_job_runtime.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,10 @@ def _extract_envs(self, dsc_job) -> dict:
11011101
# Inputs
11021102
input_mappings = envs.pop(driver_utils.CONST_ENV_INPUT_MAPPINGS, None)
11031103
if input_mappings:
1104-
spec[PyTorchDistributedRuntime.CONST_INPUT] = input_mappings
1104+
try:
1105+
spec[PyTorchDistributedRuntime.CONST_INPUT] = json.loads(input_mappings)
1106+
except ValueError:
1107+
spec[PyTorchDistributedRuntime.CONST_INPUT] = input_mappings
11051108
# Dependencies
11061109
dep = {}
11071110
if driver_utils.CONST_ENV_PIP_PKG in envs:

ads/jobs/templates/driver_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ def copy_inputs(mappings: dict = None):
283283
else:
284284
dest_dir = os.path.dirname(dest)
285285

286-
os.makedirs(dest_dir, exist_ok=True)
286+
# Do not make dirs if user is using cwd.
287+
if dest_dir:
288+
os.makedirs(dest_dir, exist_ok=True)
287289

288290
# Use native Python to download http/ftp.
289291
scheme = urlparse(src).scheme

0 commit comments

Comments
 (0)