-
Notifications
You must be signed in to change notification settings - Fork 6
Unified interface for setting random seed #254
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
Conversation
| logger.info(f"random seed: {random_seed}") | ||
| transformers.set_seed(random_seed) | ||
|
|
||
| def set_random_seed(self, seed: int) -> None: |
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.
Could you also add a test case for hf_lm.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.
Sorry, it was my oversight.
Added tests in e1cb5aa
eb5871f to
d7a05ae
Compare
|
Rebased to include the changes in #255 |
|
@junya-takayama CI looks OK now. Can you take another look, please? Thanks! |
junya-takayama
left a comment
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.
Thanks for the fix. LGTM!
Currently, the means of setting random seed is different across different language models.
For example:
This PR attempts to address this somewhat confusing behavior, by implementing
set_random_seedmethod