-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BaseDataMix class #65
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple minor comments
Base class for enumeration of data mixes. | ||
""" | ||
|
||
def build(self, base_dir: str, tokenizer: TokenizerName) -> Tuple[List[str], List[str]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the docstring for this method below to here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/olmo_core/data/mixes/__init__.py
Outdated
@@ -7,10 +7,19 @@ | |||
|
|||
from ..tokenizer import TokenizerName | |||
|
|||
__all__ = ["DataMix"] | |||
__all__ = ["BaseDataMix", "DataMix"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also export BaseDataMix
in src/olmo_core/data/__init__.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/olmo_core/data/__init__.py
Outdated
@@ -56,6 +56,7 @@ | |||
"NumpyDatasetDType", | |||
"TokenizerConfig", | |||
"TokenizerName", | |||
"BaseDataMix", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're missing the actual import above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, fixed
src/olmo_core/data/mixes/__init__.py
Outdated
|
||
|
||
class DataMix(StrEnum): | ||
class BaseDataMix(StrEnum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, minor nit, but I've gone with the convention of calling base classes XXXBase
instead of BaseXXX
. Can you change this to DataMixBase
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This allows extending the class to specify new mixes in projects using
olmo_core
.