Skip to content

Commit

Permalink
Add if-check to account for edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
amorehead authored Oct 17, 2023
1 parent 70a8bb6 commit 0a6d1bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def evaluate(cfg: DictConfig) -> Tuple[Dict[str, Any], Dict[str, Any]]:
if "_target_" in cfg.strategy:
log.info(f"Instantiating strategy <{cfg.strategy._target_}>")
strategy: Strategy = hydra.utils.instantiate(cfg.strategy)
if "mixed_precision" in strategy.__dict__:
if "mixed_precision" in strategy.__dict__ and strategy.mixed_precision is not None:
strategy.mixed_precision.param_dtype = (
resolve_omegaconf_variable(cfg.strategy.mixed_precision.param_dtype)
if cfg.strategy.mixed_precision.param_dtype is not None
Expand Down

0 comments on commit 0a6d1bb

Please sign in to comment.