Skip to content

LlamaAttention forward function type hint is incorrect from new Branch #38855

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ArkVex
Copy link

@ArkVex ArkVex commented Jun 17, 2025

Hi, this PR fixes a small issue in the LlamaAttention class. The return type in the forward method currently shows three values, but the function actually returns only two. This seems to have been missed during the attention refactor (possibly in PR #35235).

I’ve updated the type hint to reflect the actual return values, just to avoid confusion for anyone reading or using the code. Let me know if any other changes are needed. Happy to help!

@ArkVex
Copy link
Author

ArkVex commented Jun 17, 2025

@Rocketknight1 same error again

@ArkVex
Copy link
Author

ArkVex commented Jun 17, 2025

image
its saying this change is causing the issue...but this was the whole point for this pr

@yaswanth19
Copy link
Contributor

yaswanth19 commented Jun 17, 2025

Hey @ArkVex , There are many models which inherit from llama modules. So, running make fix-copies should make the CI happy

@ArkVex
Copy link
Author

ArkVex commented Jun 17, 2025

455077514-5c43c10a-e0bd-4bf1-9f2c-51a96534a46a.png

I did...but I don't know why it is throwing error

@yaswanth19
Copy link
Contributor

yaswanth19 commented Jun 17, 2025

It's working fine for me. Can't you see any changes in your branch after running. Might be that the changes have been applied and in the next run there is no diff. Otherwise install pip install -e '.[quality]' and then once again try it.

@Rocketknight1
Copy link
Member

Hi @ArkVex, the problem is that make fix-copies detects changes by comparing against your fork's main branch and not Hugging Face's main branch. Because you've made the same changes on main, it doesn't think any files have changed in your PR. You should reset your main branch to match huggingface/transformers@main, and then pull the changes to your local machine's main branch. After that, everything should work.

@kkirsche
Copy link

If it helps, the reset command(s) may look something like:

git switch main
git remote add upstream https://github.com/huggingface/transformers.git
git reset --hard upstream/main

(X-Ref to link this to the last MR: #38795)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants