nemo-evaluator-launcher 0.1.0rc6__py3-none-any.whl → 0.1.0rc8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of nemo-evaluator-launcher might be problematic. Click here for more details.

@@ -18,8 +18,10 @@
18
18
  This module provides the main functional entry points for running evaluations, querying job status, and listing available tasks. These functions are intended to be used by CLI commands and external integrations.
19
19
  """
20
20
 
21
+ from pathlib import Path
21
22
  from typing import Any, List, Optional, Union
22
23
 
24
+ import yaml
23
25
  from omegaconf import DictConfig, OmegaConf
24
26
 
25
27
  from nemo_evaluator_launcher.api.types import RunConfig
@@ -434,7 +436,42 @@ def export_results(
434
436
  single_id = invocation_ids[0]
435
437
 
436
438
  if "." in single_id: # job_id
437
- job_data = ExecutionDB().get_job(single_id)
439
+ md_job_data = None
440
+ # Use artifacts/run_config.yml if present
441
+ ypath_artifacts = Path("run_config.yml")
442
+ if ypath_artifacts.exists():
443
+ try:
444
+ cfg_yaml = (
445
+ yaml.safe_load(ypath_artifacts.read_text(encoding="utf-8"))
446
+ or {}
447
+ )
448
+ # merge exporter config if present
449
+ ypath_export = Path("export_config.yml")
450
+ if ypath_export.exists():
451
+ exp_yaml = (
452
+ yaml.safe_load(ypath_export.read_text(encoding="utf-8"))
453
+ or {}
454
+ )
455
+ exec_cfg = cfg_yaml.get("execution") or {}
456
+ auto_exp = (exp_yaml.get("execution") or {}).get(
457
+ "auto_export"
458
+ )
459
+ if auto_exp is not None:
460
+ exec_cfg["auto_export"] = auto_exp
461
+ cfg_yaml["execution"] = exec_cfg
462
+ # metadata
463
+ md_job_data = JobData(
464
+ invocation_id=single_id.split(".")[0],
465
+ job_id=single_id,
466
+ timestamp=0.0,
467
+ executor="local", #
468
+ data={"output_dir": str(Path.cwd().parent)},
469
+ config=cfg_yaml,
470
+ )
471
+ except Exception:
472
+ md_job_data = None
473
+ # fallback to execDB only
474
+ job_data = md_job_data or ExecutionDB().get_job(single_id)
438
475
  if job_data is None:
439
476
  return {
440
477
  "success": False,
@@ -470,6 +470,8 @@ def _create_slurm_sbatch_script(
470
470
  s += "#SBATCH --exclusive\n"
471
471
  s += "#SBATCH --output {}\n".format(remote_task_subdir / "logs" / "slurm-%A.out")
472
472
  s += "\n"
473
+ s += f'TASK_DIR="{str(remote_task_subdir)}"\n'
474
+ s += "\n"
473
475
 
474
476
  # collect all env vars
475
477
  env_vars = copy.deepcopy(dict(cfg.evaluation.get("env_vars", {})))
@@ -620,11 +622,22 @@ def _generate_auto_export_section(
620
622
  if not destinations:
621
623
  return ""
622
624
 
623
- s = "\n# AUTO-EXPORT ON SUCCESS\n"
625
+ s = "\n# Auto-export on success\n"
624
626
  s += "EVAL_EXIT_CODE=$?\n"
625
627
  s += "if [ $EVAL_EXIT_CODE -eq 0 ]; then\n"
626
628
  s += " echo 'Evaluation completed successfully. Starting auto-export...'\n"
627
-
629
+ s += " set +e\n" # per exporter failure allowed
630
+ s += " set +x\n"
631
+ s += ' cd "$TASK_DIR/artifacts"\n'
632
+ auto_export_cfg = OmegaConf.to_container(
633
+ cfg.execution.get("auto_export", {}), resolve=True
634
+ )
635
+ yaml_str = yaml.safe_dump(
636
+ {"execution": {"auto_export": auto_export_cfg}}, sort_keys=False
637
+ )
638
+ s += " cat > export_config.yml << 'EOF'\n"
639
+ s += yaml_str
640
+ s += "EOF\n"
628
641
  for dest in destinations:
629
642
  s += f" echo 'Exporting to {dest}...'\n"
630
643
  s += f" nemo-evaluator-launcher export {job_id} --dest {dest} || echo 'Export to {dest} failed'\n"
@@ -16,7 +16,7 @@
16
16
  MAJOR = 0
17
17
  MINOR = 1
18
18
  PATCH = 0
19
- PRE_RELEASE = "rc6"
19
+ PRE_RELEASE = "rc8"
20
20
 
21
21
  # Use the following formatting: (major, minor, patch, pre-release)
22
22
  VERSION = (MAJOR, MINOR, PATCH, PRE_RELEASE)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nemo-evaluator-launcher
3
- Version: 0.1.0rc6
3
+ Version: 0.1.0rc8
4
4
  Summary: NeMo Evaluator Launcher - Public API
5
5
  Requires-Python: <3.14,>=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1,7 +1,7 @@
1
1
  nemo_evaluator_launcher/__init__.py,sha256=2F703fttLaIyMHoVD54rptHMXt4AWnplHDrwWJ3e3PM,1930
2
- nemo_evaluator_launcher/package_info.py,sha256=s8M-v8N_HHq5p8GW7YqbgdJJu9bAi7CuDcd4erMbTD4,1427
2
+ nemo_evaluator_launcher/package_info.py,sha256=dB9BepY51PqX2mVJvt_VqH4dvUgBf1wbe6rx9aYcSEM,1427
3
3
  nemo_evaluator_launcher/api/__init__.py,sha256=U9q_MJK2vRsFaymanhyy0nD1SNAZQZC8oY45RXPX7ac,1024
4
- nemo_evaluator_launcher/api/functional.py,sha256=lsLV0RUvVqd1VG0KAgUDmHPe7DUVFJ5bVaWUuSILx7A,24918
4
+ nemo_evaluator_launcher/api/functional.py,sha256=DbsM2nwSdUZFtP5Se4aACg4K8EHF0b2xsXX_VgItP8w,26711
5
5
  nemo_evaluator_launcher/api/types.py,sha256=RXr_QoKdhejj1T9-HybSjd4KTxJmSv0bE0uLUFtF7Zc,3269
6
6
  nemo_evaluator_launcher/api/utils.py,sha256=q5HArRj7PKgBfeH3bOX8q1U97yMyQQp72yRRA5JP9PE,818
7
7
  nemo_evaluator_launcher/cli/__init__.py,sha256=lNC_skFLYTOt-arnY3ZQnZMWzHlrtD2wAoHvDcHddwM,673
@@ -39,7 +39,7 @@ nemo_evaluator_launcher/executors/local/__init__.py,sha256=lNC_skFLYTOt-arnY3ZQn
39
39
  nemo_evaluator_launcher/executors/local/executor.py,sha256=ctiyi2rMi01lzTInFdtUdetXU0JTPlT3E-acFjgWdjA,17802
40
40
  nemo_evaluator_launcher/executors/local/run.template.sh,sha256=ta55-WukiVXO2hyqqt0JCEjW23JrF41DYG0dBT1tdJA,3320
41
41
  nemo_evaluator_launcher/executors/slurm/__init__.py,sha256=lNC_skFLYTOt-arnY3ZQnZMWzHlrtD2wAoHvDcHddwM,673
42
- nemo_evaluator_launcher/executors/slurm/executor.py,sha256=xfSvQ1MRlAqM6TI9Rsmh-MNIq0DdHaHo_Vu_SlrMNUM,35813
42
+ nemo_evaluator_launcher/executors/slurm/executor.py,sha256=UE_HegK8XiacBKMg-r8IaeHwkc-h2trc3qbX8n9Y1k8,36305
43
43
  nemo_evaluator_launcher/exporters/__init__.py,sha256=mBXG9FG48FeYrs8sF0zA2mgo1eqBmRgoml7zjJrqDso,1323
44
44
  nemo_evaluator_launcher/exporters/base.py,sha256=toeitHi-reouJvhRULtsceMlpZat4fHcQIXIbAKury0,3904
45
45
  nemo_evaluator_launcher/exporters/gsheets.py,sha256=P2TeHr63qXIGh5nzXhs2l10n5_r2I2C4uWx3pbjX-EY,15084
@@ -49,9 +49,9 @@ nemo_evaluator_launcher/exporters/registry.py,sha256=XsPTv_SBAFjcErO6BJ3OHqs3EvX
49
49
  nemo_evaluator_launcher/exporters/utils.py,sha256=uXH4b-Hk7_FQyLOjMRB0b3zK-Ksb2rGlSdc-oECfGHI,24756
50
50
  nemo_evaluator_launcher/exporters/wandb.py,sha256=xdaPNw0QM0jZo20UERbViy_vFT-HgbLYzTgmWaev_kk,13430
51
51
  nemo_evaluator_launcher/resources/mapping.toml,sha256=uOg4Y-gDXXskbbba2vuwJ5FLJ3W0kSZz7Fap_nJnFQc,11322
52
- nemo_evaluator_launcher-0.1.0rc6.dist-info/licenses/LICENSE,sha256=DyGb0fqHPZAsd_uXHA0DGcOCqsvrNsImuLC0Ts4s1zI,23413
53
- nemo_evaluator_launcher-0.1.0rc6.dist-info/METADATA,sha256=Zu5b_Kd9E7KwYplX2dfuuTBYYk3yDpzeExCacip7oiA,1282
54
- nemo_evaluator_launcher-0.1.0rc6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
- nemo_evaluator_launcher-0.1.0rc6.dist-info/entry_points.txt,sha256=64z1T5GKSB9PW1fCENQuor6X6eqH1rcfg0NQGfKrEy8,130
56
- nemo_evaluator_launcher-0.1.0rc6.dist-info/top_level.txt,sha256=5PvawNm9TXKqPRjZita1xPOtFiMOipcoRf50FI1iY3s,24
57
- nemo_evaluator_launcher-0.1.0rc6.dist-info/RECORD,,
52
+ nemo_evaluator_launcher-0.1.0rc8.dist-info/licenses/LICENSE,sha256=DyGb0fqHPZAsd_uXHA0DGcOCqsvrNsImuLC0Ts4s1zI,23413
53
+ nemo_evaluator_launcher-0.1.0rc8.dist-info/METADATA,sha256=TXxBKEgA3umskozs81qc4PXNclGKqa9BjAMcvxdCUgY,1282
54
+ nemo_evaluator_launcher-0.1.0rc8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
+ nemo_evaluator_launcher-0.1.0rc8.dist-info/entry_points.txt,sha256=64z1T5GKSB9PW1fCENQuor6X6eqH1rcfg0NQGfKrEy8,130
56
+ nemo_evaluator_launcher-0.1.0rc8.dist-info/top_level.txt,sha256=5PvawNm9TXKqPRjZita1xPOtFiMOipcoRf50FI1iY3s,24
57
+ nemo_evaluator_launcher-0.1.0rc8.dist-info/RECORD,,