-
Notifications
You must be signed in to change notification settings - Fork 30.7k
Fix 29807 sinusoidal positional encodings in Flaubert, Informer and XLM #29904
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
Fix 29807 sinusoidal positional encodings in Flaubert, Informer and XLM #29904
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.
I think we could put everythin in the _init_weight? (trick is to use parent class)
I moved XLM and Flaubert to |
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 one nit to re-use the test and good to go!
config_and_inputs = self.model_tester.prepare_config_and_inputs() | ||
self.model_tester.create_and_check_flaubert_model(*config_and_inputs) | ||
|
||
def test_flaubert_model_with_sinusoidal_encodings(self): |
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.
let's use copied from for the test as well!
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.
does this solve it?
config_and_inputs = self.model_tester.prepare_config_and_inputs() | ||
self.model_tester.create_and_check_xlm_model(*config_and_inputs) | ||
|
||
def test_xlm_model_with_sinusoidal_encodings(self): |
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.
missing copied from
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.
@ArthurZucker does this solve it?
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.
Yes, but we need "with Distlbert->XLM"
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.
changed them
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.
let's use the copied from "with" statements if you see what I mean
config_and_inputs = self.model_tester.prepare_config_and_inputs() | ||
self.model_tester.create_and_check_xlm_model(*config_and_inputs) | ||
|
||
def test_xlm_model_with_sinusoidal_encodings(self): |
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.
Yes, but we need "with Distlbert->XLM"
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 thanks you!
What does this PR do?
Fixes #29807, sinusoidal positional encodings overwritten by post_init(), for Flauber, Informer and XLM models
Before submitting
to it if that's the case.
Sinusoidal positional encodings overwritten by post_init() #29807
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@ArthurZucker, @younesbelkada, @amyeroberts