Skip to content
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: fix adaptation prompt CI and compatibility with latest transformers (4.35.0) #1084

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

younesbelkada
Copy link
Contributor

What does this PR do?

As per title, fixes the current CI for adaption prompt and makes it compatible.
Transformers refactored the way positional embeddings are computed for llama, in the previous versions cos and sin cache values had a shape of length 4, now it was only a shape of length 2, breaking the assumptions we made in llama_apply_rotary_pos_emb.

I propose to keep the previous behaviour in case len(cos.shape) == 4, and fall back to the newest way of computing q_embed as depicted here: https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/modeling_llama.py#L222-L226

cc @BenjaminBossan @pacman100

@BenjaminBossan
Copy link
Member

Thanks for identifying the issue. Could you please also undo these changes:

https://github.com/huggingface/peft/pull/1077/files#diff-2d7467165fbcbb3c9f83e0ca3ed12834e9e1a596176d01b10e8898e3f1058f55

@younesbelkada
Copy link
Contributor Author

Good point Thanks! Done now!

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 6, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @younesbelkada for fixing this!

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, can be merged as soon as CI is green.

@younesbelkada younesbelkada merged commit 276c91b into huggingface:main Nov 6, 2023
11 checks passed
@younesbelkada younesbelkada deleted the fix-ci-v435 branch November 6, 2023 13:04
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