-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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 'vocab_size' attribute of LlavaConfig #29794
Conversation
@amyeroberts Could you please take a look since you reviewed the original Llava-1.6 PR? cc @xwjiang2010 |
related #29389 (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 fixing this! And apologies for breaking things.
For full backwards compatibility, I think we also need the setter solution from @fxmarty.
This way, vocab_size
won't set automatically, but the previous functionality of
config.vocab_size = value
still works
@@ -137,6 +137,7 @@ def __init__( | |||
self.text_config = text_config | |||
self._vocab_size = self.text_config.vocab_size | |||
|
|||
kwargs.pop("vocab_size", 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 move this to L108? This way we'll more easily remember to remove is when it's fully deprecated
@ywang96 Thanks for opening this PR! We merged in #29389, which handles the breaking error. Thinking about it more, at the moment, we shouldn't need to pop from the kwargs with the setter solution. Later, once deprecated (i.e. we've had a ~2 months of warnings that it's not used), we'll want to allow users to still pass in this argument, as technically for any config I can do:
and the param foo will be set, even if it's not a argument of the config. So we really keep Closing for now, as the issue is addressed. |
Sounds good - I'm okay with either as long as the issue is fixed, and I agree the setter solution is cleaner. Thanks! |
@ywang96 A patch v4.39.1 has just been released with the fix |
What does this PR do?
This PR fixes a bug from #29586 where it made
vocab_size
a read-only property ofLlavaConfig
, preventing it from being assigned during thesuper().__init__(**kwargs)
. The fix is to popvocab_size
from kwargs before we callsuper().__init__(**kwargs)
.Fixes ##29789
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.