Skip to content

Commit

Permalink
fixed eval_model nb, added ZanjHookedTransformer.config ref
Browse files Browse the repository at this point in the history
the `eval_model.ipynb` notebook has a function `testdata_plot_predicted_path`
which was using `model.zanj_model_config` to get the tokenizer, an attribute
missing from the `RandomBaseline` class since it only inherits from `HookedTransformer`

to fix this:

- `ZanjHookedTransformer` now has a `config` property which just
  accesses the `zanj_model_config` used by the parent `ConfiguredModel`
- `testdata_plot_predicted_path` now uses `model.config` everywhere
  • Loading branch information
mivanit committed Aug 3, 2023
1 parent 2ee2f3e commit a06378d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
4 changes: 4 additions & 0 deletions maze_transformer/training/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@ def __init__(self, cfg_holder: ConfigHolder) -> None:
tokenizer=cfg_holder.tokenizer,
)

@property
def config(self) -> ConfigHolder:
return self.zanj_model_config

def _load_state_dict_wrapper(
self,
state_dict: dict[str, Any],
Expand Down
Loading

0 comments on commit a06378d

Please sign in to comment.