Skip to content

Commit

Permalink
typing?
Browse files Browse the repository at this point in the history
  • Loading branch information
aspfohl committed Dec 11, 2023
1 parent 9754b03 commit 1ac70cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions llmfoundry/utils/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def build_icl_data_and_gauntlet(
def build_callback(
name: str,
kwargs: Union[DictConfig, Dict[str, Any]],
config: Optional[Dict[str, Any]] = None,
config: Any = None,
) -> Callback:
if name == 'lr_monitor':
return LRMonitor()
Expand Down Expand Up @@ -213,11 +213,7 @@ def build_callback(
raise ValueError(
'Parameters config is required for async eval callback')

config_dict = {
k: v if isinstance(v, str) else om.to_container(v, resolve=True)
for k, v in kwargs.items()
}
return AsyncEval(**kwargs, training_config=config_dict)
return AsyncEval(**kwargs, training_config=config)
else:
raise ValueError(f'Not sure how to build callback: {name}')

Expand Down
2 changes: 1 addition & 1 deletion scripts/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def main(cfg: DictConfig) -> Trainer:

# Callbacks
callbacks: List[Callback] = [
build_callback(str(name), callback_cfg, logged_cfg)
build_callback(str(name), callback_cfg, om.to_container(logged_cfg))
for name, callback_cfg in callback_configs.items()
] if callback_configs else []

Expand Down

0 comments on commit 1ac70cc

Please sign in to comment.