Skip to content

Commit

Permalink
added path to current script repo based on #1189
Browse files Browse the repository at this point in the history
  • Loading branch information
gfursin committed Apr 15, 2024
1 parent 7bc14cc commit e944487
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion cm-mlops/automation/script/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def run(self, i):
(repro_prefix) (str): if !='', use it to record above files {repro-prefix)-input.json ...
(repro_dir) (str): if !='', use this directory to dump info
(script_call_prefix) (str): how to call script in logs and READMEs (cm run script)
...
Returns:
Expand Down Expand Up @@ -477,7 +478,9 @@ def _run(self, i):
# print (recursion_spaces + '* Running ' + cm_script_info)


cm_script_info = 'cm run script '
cm_script_info = i.get('script_call_prefix', '').strip()
if cm_script_info == '': cm_script_info = 'cm run script'
if not cm_script_info.endswith(' '): cm_script_info+=' '

x = '"'
y = ' '
Expand Down Expand Up @@ -689,6 +692,16 @@ def _run(self, i):
meta = script_artifact.meta
path = script_artifact.path

# Check path to repo
script_repo_path = script_artifact.repo_path

script_repo_path_with_prefix = script_artifact.repo_path
if script_artifact.repo_meta.get('prefix', '') != '':
script_repo_path_with_prefix = os.path.join(script_repo_path, script_artifact.repo_meta['prefix'])

env['CM_TMP_CURRENT_SCRIPT_REPO_PATH'] = script_repo_path
env['CM_TMP_CURRENT_SCRIPT_REPO_PATH_WITH_PREFIX'] = script_repo_path_with_prefix

# Check if has --help
if i.get('help',False):
return utils.call_internal_module(self, __file__, 'module_help', 'print_help', {'meta':meta, 'path':path})
Expand Down
4 changes: 2 additions & 2 deletions cm-mlops/script/get-dataset-coco2014/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ deps:
- python3
tags: get,python3

- tags: get,generic-python-lib,_tqdm

- force_env_keys:
- CM_GIT_*
names:
- inference-src
tags: mlperf,inference,source
version: master

- tags: get,generic-python-lib,_tqdm

env:
CM_DATASET: COCO2014

Expand Down

0 comments on commit e944487

Please sign in to comment.