Skip to content

Commit

Permalink
Merge pull request #291 from melo-gonzo/290-feature-request-support-a…
Browse files Browse the repository at this point in the history
…rgs-unpacking-when-creating-classes-in-the-experiment-cli

CLI `instantiate_arg_dict` Update
  • Loading branch information
laserkelvin authored Sep 17, 2024
2 parents 48f1080 + 3dddb50 commit 6c9658d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion experiments/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ def instantiate_arg_dict(input: Union[list, dict[str, Any]]) -> dict[str, Any]:
else:
transform_args = input_args
class_path = get_class_from_name(class_path)
return class_path(**transform_args)
if "class_path" in transform_args:
args = instantiate_arg_dict(transform_args)
return class_path(args)
else:
return class_path(**transform_args)
if key == "encoder_class":
input[key] = get_class_from_name(value["class_path"])
elif isinstance(value, dict) and "class_path" in value:
Expand Down

0 comments on commit 6c9658d

Please sign in to comment.