Skip to content

Commit

Permalink
Ensure additional metadata to trackers don't throw error in happy cas…
Browse files Browse the repository at this point in the history
…e. (#290)

Signed-off-by: Dushyant Behl <[email protected]>
  • Loading branch information
dushyantbehl authored Aug 7, 2024
1 parent d224be6 commit baeecf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions tuning/sft_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ def train(
try:
for k, v in additional_metrics.items():
tracker.track(metric=v, name=k, stage="additional_metrics")
if exp_metadata:
tracker.set_params(params=exp_metadata, name="experiment_metadata")
except ValueError as e:
logger.error(
Expand Down
4 changes: 3 additions & 1 deletion tuning/trackers/aimstack_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ def set_params(self, params, name="extra_params"):
Raises:
ValueError: the params passed is None or not of type dict
"""
if params is None or (not isinstance(params, dict)):
if params is None:
return
if not isinstance(params, dict):
raise ValueError(
"set_params passed to aimstack should be called with a dict of params"
)
Expand Down

0 comments on commit baeecf1

Please sign in to comment.