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 RoPE config validation for FalconConfig + various config typos #26929

Merged
merged 5 commits into from
Oct 24, 2023

Conversation

tomaarsen
Copy link
Member

What does this PR do?

One change that fixes a bug:

  • Fix RoPE config validation: config = FalconConfig(alibi=False, rope_scaling={"type": "linear", "factor": 2.0}) would fail. (1fbd699)

And three changes that fix typos/improve maintainability etc.

  • Fix code block tag (b9e4f0a)
  • Fix typos: an float -> a float (69214ce)
  • Implement copy functionality for Fuyu and Persimmon (4ee278a)

I can split this up into two smaller PRs if preferred - just let me know.

Details

Fix RoPE config validation

from transformers import FalconConfig

config = FalconConfig(alibi=False, rope_scaling={"type": "linear", "factor": 2.0})

Running this on main produces:

ValueError: `rope_scaling` is not supported when `alibi` is `True`.

Which is obviously nonsensical. This is caused by if self.rotary: raise ValueError where self.rotary is just not self.alibi. So, this ValueError is thrown when alibi is False, not when it is True.

The other 3 changes speak for themselves.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

No new tests - I can add one for the first bug fix if preferred.

Who can review?

@gante

  • Tom Aarsen

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Member

@gante gante 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 for fixing my sloppy english :D

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Thanks for the nits

@gante gante merged commit 6cbc136 into huggingface:main Oct 24, 2023
19 checks passed
@tomaarsen tomaarsen deleted the hotfix/rope_config branch October 24, 2023 19:07
staghado pushed a commit to staghado/transformers that referenced this pull request Oct 24, 2023
…uggingface#26929)

* Resolve incorrect ValueError in RoPE config for Falcon

* Add broken codeblock tag in Falcon Config

* Fix typo: an float -> a float

* Implement copy functionality for Fuyu and Persimmon

for RoPE scaling validation

* Make style
i4never pushed a commit to i4never/transformers that referenced this pull request Oct 25, 2023
…uggingface#26929)

* Resolve incorrect ValueError in RoPE config for Falcon

* Add broken codeblock tag in Falcon Config

* Fix typo: an float -> a float

* Implement copy functionality for Fuyu and Persimmon

for RoPE scaling validation

* Make style
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
…uggingface#26929)

* Resolve incorrect ValueError in RoPE config for Falcon

* Add broken codeblock tag in Falcon Config

* Fix typo: an float -> a float

* Implement copy functionality for Fuyu and Persimmon

for RoPE scaling validation

* Make style
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