-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
237 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
# Copyright 2024 MosaicML LLM Foundry authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from omegaconf import OmegaConf as om | ||
|
||
from llmfoundry.utils.builders import build_callback | ||
|
||
|
||
def test_curriculum_learning_callback_builds(): | ||
kwargs = {'dataset_index': 0} | ||
conf_path = 'scripts/train/yamls/pretrain/testing.yaml' | ||
with open(conf_path) as f: | ||
test_cfg = om.load(f) | ||
kwargs = { | ||
'schedule': [{ | ||
'duration': '1ep', | ||
'train_loader': test_cfg.train_loader | ||
}, { | ||
'duration': '2ep', | ||
'train_loader': {} | ||
}] | ||
} | ||
|
||
callback = build_callback( | ||
'curriculum_learning', | ||
kwargs=kwargs, | ||
train_config={'train_loader': {}}, | ||
train_config=test_cfg, | ||
) | ||
assert callback is not None |