-
Notifications
You must be signed in to change notification settings - Fork 14
update gemma4 rope #90
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
Changes from 1 commit
45e547a
59e1886
f6028ed
33f821d
d50b85e
59c9622
a71b91a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -551,7 +551,7 @@ def _set_inv_freq(self): | |
| rope_scaling = self.config.rope_scaling | ||
| self.config.rope_scaling = rope_scaling['sliding_attention'] | ||
| new_inv_freq, attention_scaling = get_rope_inv_freq(self.config) | ||
| assert attention_scaling == 1, 'not support' | ||
| self.config.attention_scaling = attention_scaling | ||
| self.rotary_pos_emb.inv_freq = new_inv_freq.to(self.rotary_pos_emb.inv_freq.device) | ||
| # full | ||
| self.full_rotary_pos_emb = copy.copy(self.rotary_pos_emb) | ||
|
|
@@ -561,9 +561,8 @@ def _set_inv_freq(self): | |
| kwargs['head_dim_key'] = 'global_head_dim' | ||
| new_inv_freq, attention_scaling = get_rope_inv_freq( | ||
| self.config, text_config=self.config.hf_config.text_config, **kwargs) | ||
| assert attention_scaling == 1, 'not support' | ||
| self.full_rotary_pos_emb.inv_freq = new_inv_freq | ||
| self.config.attention_scaling = attention_scaling | ||
| self.config.full_attention_scaling = attention_scaling | ||
|
Jintao-Huang marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The attribute |
||
|
|
||
| self.config.rope_scaling = rope_scaling | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.