Skip to content

Commit

Permalink
config_overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
aspfohl committed Nov 14, 2023
1 parent b58ccf9 commit d85ee5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
9 changes: 2 additions & 7 deletions llmfoundry/callbacks/async_eval_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ def get_eval_models_dict(
tokenizer: Dict[str, Any],
) -> List[Dict[str, Any]]:
name = model.get('name')

cfg_overrides = model.pop('config_overrides', {})
for key in cfg_overrides:
model[key] = cfg_overrides[key]

new_model = {'model_name': name, 'model': model}

if tokenizer:
Expand Down Expand Up @@ -125,8 +120,8 @@ def run_event(self, event: Event, state: State, logger: Logger) -> None:
del logger
if all([
state.get_elapsed_duration() is not None,
self.check_interval(state, event),
self.last_launch != state.timestamp.batch,
self.check_interval(state, event), self.last_launch
!= state.timestamp.batch,
dist.get_global_rank() == 0
]):
self.launch_run()
Expand Down
20 changes: 13 additions & 7 deletions tests/callbacks/test_async_eval_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ def test_get_eval_parameters():
'model_name': 'model_example',
'model': {
'name': 'model_example',
'attn_config': {
'foo': 'bar'
'config_overrides': {
'attn_config': {
'foo': 'bar'
},
},
},
'tokenizer': {
Expand Down Expand Up @@ -139,8 +141,10 @@ def test_get_eval_parameters():
'model_name': 'model_example',
'model': {
'name': 'model_example',
'attn_config': {
'foo': 'bar'
'config_overrides': {
'attn_config': {
'foo': 'bar'
},
},
},
'tokenizer': {
Expand Down Expand Up @@ -226,9 +230,11 @@ def test_async_eval_callback_minimal(mock_create_run: MagicMock,
'model_name': 'model_example',
'model': {
'name': 'model_example',
'attn_config': {
'foo': 'bar'
}
'config_overrides': {
'attn_config': {
'foo': 'bar'
},
},
},
'tokenizer': {
'tokenizer_example': 'tokenizer_example'
Expand Down

0 comments on commit d85ee5e

Please sign in to comment.