-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Refactor/fix Cohere2 #35594
Refactor/fix Cohere2 #35594
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
cc @ArthurZucker, and @alexrs-cohere if you want to have a look! |
@@ -181,117 +175,29 @@ def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_dim=1): | |||
|
|||
|
|||
def eager_attention_forward( | |||
config: Cohere2Config, | |||
module: nn.Module, |
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.
cc @ydshieh 😉
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!!!!!!!!!!
dropout: float = 0.0, | ||
**kwargs, | ||
): | ||
key_states = repeat_kv(key, module.num_key_value_groups) |
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't we import 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.
Oh indeed, good point! More code cut 🤗
What does this PR do?
Refactor Cohere2 to meet recent standards, and fix #35547 at the same time