-
Notifications
You must be signed in to change notification settings - Fork 6
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
13 changed files
with
123 additions
and
75 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
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
38 changes: 17 additions & 21 deletions
38
tests/unit/maze_transformer/training/config/test_cfg_post_init.py
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,27 +1,23 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
from maze_dataset import MazeDatasetConfig | ||
from zanj import ZANJ | ||
|
||
from maze_dataset.tokenization import MazeTokenizer | ||
|
||
from maze_transformer.training.config import BaseGPTConfig, ConfigHolder, TrainConfig | ||
|
||
def test_cfg_post_init(): | ||
|
||
cfg: ConfigHolder = ConfigHolder( | ||
train_cfg=TrainConfig(name="test_cfg_save-train"), | ||
dataset_cfg=MazeDatasetConfig(name="test_cfg_save-data", grid_n=5, n_mazes=10), | ||
model_cfg=BaseGPTConfig( | ||
name="test_cfg_save-model", | ||
act_fn="dummy-act-fn", | ||
d_model=500, | ||
d_head=60, | ||
n_layers=4, | ||
), | ||
) | ||
def test_cfg_post_init(): | ||
cfg: ConfigHolder = ConfigHolder( | ||
train_cfg=TrainConfig(name="test_cfg_save-train"), | ||
dataset_cfg=MazeDatasetConfig(name="test_cfg_save-data", grid_n=5, n_mazes=10), | ||
model_cfg=BaseGPTConfig( | ||
name="test_cfg_save-model", | ||
act_fn="dummy-act-fn", | ||
d_model=500, | ||
d_head=60, | ||
n_layers=4, | ||
), | ||
) | ||
|
||
assert isinstance(cfg.maze_tokenizer, MazeTokenizer) | ||
assert isinstance(cfg.maze_tokenizer.max_grid_size, int) | ||
assert cfg.maze_tokenizer.max_grid_size == 5 | ||
assert isinstance(cfg.maze_tokenizer.vocab_size, int) | ||
assert isinstance(cfg.maze_tokenizer, MazeTokenizer) | ||
assert isinstance(cfg.maze_tokenizer.max_grid_size, int) | ||
assert cfg.maze_tokenizer.max_grid_size == 5 | ||
assert isinstance(cfg.maze_tokenizer.vocab_size, int) |
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
Oops, something went wrong.