transformers icon indicating copy to clipboard operation
transformers copied to clipboard

LlamaAttention forward function type hint is incorrect #38739

Open ArkVex opened this issue 7 months ago • 6 comments

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 avatar Jun 12 '25 15:06 ArkVex

Hi @ArkVex can you run make fix-copies to propagate that change to other models that are copying from Llama? That should make the CI pass!

Rocketknight1 avatar Jun 13 '25 11:06 Rocketknight1

Hi @ArkVex can you run make fix-copies to propagate that change to other models that are copying from Llama? That should make the CI pass!

I didnt get that...could you plz explain?

ArkVex avatar Jun 13 '25 12:06 ArkVex

Hi @ArkVex, if you look at the tests on this PR, "check_repository_consistency" is failing. The reason is that some other models copy from Llama, and those copies don't match after this PR. You should run make fix-copies in the transformers directory and then commit + push those changes, which should fix the problem.

Rocketknight1 avatar Jun 13 '25 13:06 Rocketknight1

Hi @ArkVex, if you look at the tests on this PR, "check_repository_consistency" is failing. The reason is that some other models copy from Llama, and those copies don't match after this PR. You should run make fix-copies in the transformers directory and then commit + push those changes, which should fix the problem.

Thanks for pointing it out...i will do the same

ArkVex avatar Jun 13 '25 15:06 ArkVex

image I did the test...plz check

ArkVex avatar Jun 13 '25 23:06 ArkVex

@Rocketknight1 you there?

ArkVex avatar Jun 14 '25 17:06 ArkVex

@vanpelt @dxoigmn @tmm1 anyone plz review

ArkVex avatar Jun 16 '25 01:06 ArkVex

Seems like make fix-copies isn't working correctly, very odd! I can run it, one sec.

Rocketknight1 avatar Jun 16 '25 14:06 Rocketknight1

Hi @ArkVex, the reason it's failing is that the PR is on your fork's main branch. This breaks things! I recommend:

  1. Close this PR
  2. Make a new branch in your fork
  3. Push the change there
  4. Run make fix-copies
  5. Open a PR from that branch and ping me

Rocketknight1 avatar Jun 16 '25 14:06 Rocketknight1

Hi @ArkVex, the reason it's failing is that the PR is on your fork's main branch. This breaks things! I recommend:

  1. Close this PR
  2. Make a new branch in your fork
  3. Push the change there
  4. Run make fix-copies
  5. Open a PR from that branch and ping me

Okk oKk

ArkVex avatar Jun 16 '25 17:06 ArkVex