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

Update falcon model card #37184

Merged
merged 17 commits into from
Apr 3, 2025
Merged

Conversation

ricalanis
Copy link
Contributor

@ricalanis ricalanis commented Apr 1, 2025

Fixes #36979

  • Updated the Falcon model card
  • Did not update Falcon3 as it is not explicitly listed, but can do it also
  • Did not include the attention visualizer as I was not able to implement it for Falcon models in a straightforward way.
  • First contrib, thank you for your patience <3

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? NA

@github-actions github-actions bot marked this pull request as draft April 1, 2025 19:11
Copy link

github-actions bot commented Apr 1, 2025

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the Ready for review button (at the bottom of the PR page). This will assign reviewers and trigger CI.

@ricalanis ricalanis marked this pull request as ready for review April 1, 2025 19:13
@github-actions github-actions bot requested a review from stevhliu April 1, 2025 19:13
Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Great work! 🚀

<hfoption id="Pipeline">

```py
from transformers import pipeline
Copy link
Member

Choose a reason for hiding this comment

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

Can do this:

import torch
from transformers import pipeline

pipeline = pipeline(
    task="text-generation", 
    model="tiiuae/falcon-7b-instruct",
    torch_dtype=torch.bfloat16,
    device=0
)
pipeline(
    "Write a short poem about coding",
    max_length=100,
    do_sample=True,
    temperature=0.7
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added!

- Falcon models come in different sizes (7B, 40B, 180B parameters) and variants (base and instruct).
- The "instruct" versions have been fine-tuned on instruction data and are better for conversational or instruction-following tasks.
- For most applications, using FlashAttention or SDPA optimization is recommended for the best performance.
- If you're upgrading from an older custom code checkpoint, remember to convert it to the official Transformers format using the conversion script located in the
Copy link
Member

Choose a reason for hiding this comment

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

Add snippet under here for using the script

Suggested change
- If you're upgrading from an older custom code checkpoint, remember to convert it to the official Transformers format using the conversion script located in the
- If you're upgrading from an older custom code checkpoint, remember to convert it to the official Transformers format for better stability and performance using the conversion script located in the

@ricalanis
Copy link
Contributor Author

Thank you for your kind suggestions, @stevhliu. Added all of them, so ready for you to review again.

@HuggingFaceDocBuilderDev

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.

@ricalanis
Copy link
Contributor Author

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.

Thanks to this build i was able to spot a typo. Fixed.

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Thanks, just two more minor changes and we can merge! 🔥

@stevhliu stevhliu merged commit 3e96a0c into huggingface:main Apr 3, 2025
10 checks passed
duanjunwen pushed a commit to duanjunwen/transformers that referenced this pull request Apr 3, 2025
* feat: updated model card for falcon

* fix:rewrite model description

* fix: add link to conversion script

* Update docs/source/en/model_doc/falcon.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/falcon.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/falcon.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/falcon.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/falcon.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/falcon.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/falcon.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/falcon.md

Co-authored-by: Steven Liu <[email protected]>

* fix: Add suggested changes

* fix: typo in link for quantization

* Update docs/source/en/model_doc/falcon.md

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/en/model_doc/falcon.md

Co-authored-by: Steven Liu <[email protected]>

* fix: fix indent and close ticks

* fix: add indent

---------

Co-authored-by: Steven Liu <[email protected]>
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.

[Community contributions] Model cards
3 participants