Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
dakinggg committed Apr 5, 2024
1 parent f327dc3 commit 01e1d7e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions llmfoundry/layers_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@
entry_points=True,
description=_norm_description)

_ffns_description = """The ffns registry is used to register functions that build ffn layers."""
_ffns_description = (
'The ffns registry is used to register functions that build ffn layers.' +
'See ffn.py for examples.')
ffns = create_registry('llmfoundry',
'ffns',
generic_type=Callable,
entry_points=True,
description=_ffns_description)

_ffns_with_norm_description = """The ffns_with_norm registry is used to register functions that build ffn layers that apply a normalization layer."""
_ffns_with_norm_description = (
'The ffns_with_norm registry is used to register functions that build ffn layers that apply a normalization layer.'
+ 'See ffn.py for examples.')
ffns_with_norm = create_registry('llmfoundry',
'ffns_with_norm',
generic_type=Callable,
Expand Down
4 changes: 3 additions & 1 deletion llmfoundry/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from transformers import PreTrainedTokenizerBase

from llmfoundry.interfaces import CallbackWithConfig
from llmfoundry.layers_registry import norms
from llmfoundry.layers_registry import ffns, ffns_with_norm, norms
from llmfoundry.utils.registry_utils import create_registry

_loggers_description = (
Expand Down Expand Up @@ -121,4 +121,6 @@
'metrics',
'dataloaders',
'norms',
'ffns',
'ffns_with_norm',
]
2 changes: 2 additions & 0 deletions tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def test_expected_registries_exist():
'metrics',
'models',
'norms',
'ffns',
'ffns_with_norm',
}

assert existing_registries == expected_registry_names
Expand Down

0 comments on commit 01e1d7e

Please sign in to comment.