Skip to content

Commit

Permalink
Fix artifact saving (#10914)
Browse files Browse the repository at this point in the history
Signed-off-by: Hemil Desai <[email protected]>
Signed-off-by: Alexandros Koumparoulis <[email protected]>
  • Loading branch information
hemildesai authored and akoumpa committed Oct 24, 2024
1 parent 76fe97d commit 803cf04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nemo/lightning/io/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,12 @@ def _io_path_elements_fn(x):
def _artifact_transform_save(cfg: fdl.Config, output_path: Path, relative_dir: Path = "."):
for artifact in getattr(cfg.__fn_or_cls__, "__io_artifacts__", []):
# Allow optional artifacts
if artifact.skip:
if artifact.skip or (not hasattr(cfg, artifact.attr) and not artifact.required):
continue

if not hasattr(cfg, artifact.attr) and artifact.required:
raise ValueError(f"Artifact '{artifact.attr}' is required but not provided")

current_val = getattr(cfg, artifact.attr)
if current_val is None:
if artifact.required:
Expand Down

0 comments on commit 803cf04

Please sign in to comment.