url
string
repository_url
string
labels_url
string
comments_url
string
events_url
string
html_url
string
id
int64
node_id
string
number
int64
title
string
user
dict
labels
list
state
string
locked
bool
assignee
dict
assignees
list
milestone
null
comments
list
created_at
timestamp[ms]
updated_at
timestamp[ms]
closed_at
timestamp[ms]
author_association
string
type
dict
active_lock_reason
null
draft
bool
pull_request
dict
body
string
closed_by
dict
reactions
dict
timeline_url
string
performed_via_github_app
null
state_reason
string
sub_issues_summary
dict
issue_dependencies_summary
dict
is_pull_request
bool
is_closed
bool
https://api.github.com/repos/huggingface/transformers/issues/37417
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37417/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37417/comments
https://api.github.com/repos/huggingface/transformers/issues/37417/events
https://github.com/huggingface/transformers/pull/37417
2,985,106,489
PR_kwDOCUB6oc6SEdKS
37,417
[bug] fsdp training save checkpoint twice
{ "login": "cyr0930", "id": 14088169, "node_id": "MDQ6VXNlcjE0MDg4MTY5", "avatar_url": "https://avatars.githubusercontent.com/u/14088169?v=4", "gravatar_id": "", "url": "https://api.github.com/users/cyr0930", "html_url": "https://github.com/cyr0930", "followers_url": "https://api.github.com/users/cyr0930/followers", "following_url": "https://api.github.com/users/cyr0930/following{/other_user}", "gists_url": "https://api.github.com/users/cyr0930/gists{/gist_id}", "starred_url": "https://api.github.com/users/cyr0930/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cyr0930/subscriptions", "organizations_url": "https://api.github.com/users/cyr0930/orgs", "repos_url": "https://api.github.com/users/cyr0930/repos", "events_url": "https://api.github.com/users/cyr0930/events{/privacy}", "received_events_url": "https://api.github.com/users/cyr0930/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-04-10T09:48:26
2025-04-10T12:15:52
null
CONTRIBUTOR
null
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37417", "html_url": "https://github.com/huggingface/transformers/pull/37417", "diff_url": "https://github.com/huggingface/transformers/pull/37417.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37417.patch", "merged_at": null }
# What does this PR do? FSDP training save checkpoint twice as pytorch_model_fsdp.bin and model.safetensors. And saving model during calling _save_optimizer_and_scheduler is not intuitive. (Maybe I have to rename final checkpoint or save it as safetensors format.) ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @zach-huggingface @SunMarc <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37417/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37417/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/37416
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37416/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37416/comments
https://api.github.com/repos/huggingface/transformers/issues/37416/events
https://github.com/huggingface/transformers/pull/37416
2,985,094,451
PR_kwDOCUB6oc6SEajN
37,416
mark llama4 as not supported with fa2
{ "login": "winglian", "id": 381258, "node_id": "MDQ6VXNlcjM4MTI1OA==", "avatar_url": "https://avatars.githubusercontent.com/u/381258?v=4", "gravatar_id": "", "url": "https://api.github.com/users/winglian", "html_url": "https://github.com/winglian", "followers_url": "https://api.github.com/users/winglian/followers", "following_url": "https://api.github.com/users/winglian/following{/other_user}", "gists_url": "https://api.github.com/users/winglian/gists{/gist_id}", "starred_url": "https://api.github.com/users/winglian/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/winglian/subscriptions", "organizations_url": "https://api.github.com/users/winglian/orgs", "repos_url": "https://api.github.com/users/winglian/repos", "events_url": "https://api.github.com/users/winglian/events{/privacy}", "received_events_url": "https://api.github.com/users/winglian/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-04-10T09:43:42
2025-04-16T18:42:38
2025-04-10T09:48:46
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37416", "html_url": "https://github.com/huggingface/transformers/pull/37416", "diff_url": "https://github.com/huggingface/transformers/pull/37416.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37416.patch", "merged_at": "2025-04-10T09:48:46" }
# What does this PR do? While FA2 does "work" with Llama-4, according to @ArthurZucker it still needs kernel support. It's probably best to mark this as not supported otherwise folks might burn cycles wondering why it's not truly converging when training (or inferencing) For example, using Scout with prefix of `Roses are red,`, the implementations complete these as follows: - FA2: `['<|begin_of_text|>Roses are red, of the1 in']` - flex: `['<|begin_of_text|>Roses are red, violets are blue']` <!-- Remove if not applicable --> Fixes # (issue) ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @ArthurZucker Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37416/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 1, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37416/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37415
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37415/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37415/comments
https://api.github.com/repos/huggingface/transformers/issues/37415/events
https://github.com/huggingface/transformers/pull/37415
2,984,949,251
PR_kwDOCUB6oc6SD63_
37,415
Fix new failure reports not including anything other than `tests/models/`
{ "login": "ydshieh", "id": 2521628, "node_id": "MDQ6VXNlcjI1MjE2Mjg=", "avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ydshieh", "html_url": "https://github.com/ydshieh", "followers_url": "https://api.github.com/users/ydshieh/followers", "following_url": "https://api.github.com/users/ydshieh/following{/other_user}", "gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}", "starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions", "organizations_url": "https://api.github.com/users/ydshieh/orgs", "repos_url": "https://api.github.com/users/ydshieh/repos", "events_url": "https://api.github.com/users/ydshieh/events{/privacy}", "received_events_url": "https://api.github.com/users/ydshieh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-10T08:49:41
2025-04-10T12:47:25
2025-04-10T12:47:23
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37415", "html_url": "https://github.com/huggingface/transformers/pull/37415", "diff_url": "https://github.com/huggingface/transformers/pull/37415.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37415.patch", "merged_at": "2025-04-10T12:47:23" }
# What does this PR do? Fix new failure reports not including anything other than `tests/models/`
{ "login": "ydshieh", "id": 2521628, "node_id": "MDQ6VXNlcjI1MjE2Mjg=", "avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ydshieh", "html_url": "https://github.com/ydshieh", "followers_url": "https://api.github.com/users/ydshieh/followers", "following_url": "https://api.github.com/users/ydshieh/following{/other_user}", "gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}", "starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions", "organizations_url": "https://api.github.com/users/ydshieh/orgs", "repos_url": "https://api.github.com/users/ydshieh/repos", "events_url": "https://api.github.com/users/ydshieh/events{/privacy}", "received_events_url": "https://api.github.com/users/ydshieh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37415/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37415/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37414
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37414/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37414/comments
https://api.github.com/repos/huggingface/transformers/issues/37414/events
https://github.com/huggingface/transformers/pull/37414
2,984,916,865
PR_kwDOCUB6oc6SDz4v
37,414
Fix Llama4 offset
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-10T08:37:18
2025-04-10T09:41:00
2025-04-10T09:40:58
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37414", "html_url": "https://github.com/huggingface/transformers/pull/37414", "diff_url": "https://github.com/huggingface/transformers/pull/37414.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37414.patch", "merged_at": "2025-04-10T09:40:58" }
# What does this PR do? See title. It's the same as before + 1. Indeed, we need to add the +1 to match correctly the positions, it's also what is done in gemma2 here https://github.com/huggingface/transformers/blob/main/src/transformers/models/gemma2/modeling_gemma2.py#L912-L913 as it uses the length (which is equal to cache_position[-1] + 1). I used `first_cache_position - attention_chunk_size + 1` here as I feel it simpler to understand when looking at the cache code (see the 1-offset here https://github.com/huggingface/transformers/blob/main/src/transformers/cache_utils.py#L1921-L1922), but it is striclty equal. I.e. we always have `max(first_cache_position - attention_chunk_size + 1, 0) == max(last_cache_position + 1 - key_length, 0)`
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37414/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37414/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37413
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37413/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37413/comments
https://api.github.com/repos/huggingface/transformers/issues/37413/events
https://github.com/huggingface/transformers/pull/37413
2,984,910,776
PR_kwDOCUB6oc6SDyjW
37,413
guard on model.eval when using torch.compile + FSDP2
{ "login": "winglian", "id": 381258, "node_id": "MDQ6VXNlcjM4MTI1OA==", "avatar_url": "https://avatars.githubusercontent.com/u/381258?v=4", "gravatar_id": "", "url": "https://api.github.com/users/winglian", "html_url": "https://github.com/winglian", "followers_url": "https://api.github.com/users/winglian/followers", "following_url": "https://api.github.com/users/winglian/following{/other_user}", "gists_url": "https://api.github.com/users/winglian/gists{/gist_id}", "starred_url": "https://api.github.com/users/winglian/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/winglian/subscriptions", "organizations_url": "https://api.github.com/users/winglian/orgs", "repos_url": "https://api.github.com/users/winglian/repos", "events_url": "https://api.github.com/users/winglian/events{/privacy}", "received_events_url": "https://api.github.com/users/winglian/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-10T08:34:44
2025-08-11T11:22:43
2025-08-11T11:22:42
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37413", "html_url": "https://github.com/huggingface/transformers/pull/37413", "diff_url": "https://github.com/huggingface/transformers/pull/37413.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37413.patch", "merged_at": "2025-08-11T11:22:42" }
# What does this PR do? If the model is torch.compile(d) and if we're using FSDP2, after `self._wrap_model(...)` is called, the model is actually the `model.forward` function, so it's not possible to call `.eval()` on it ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37413/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37413/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37412
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37412/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37412/comments
https://api.github.com/repos/huggingface/transformers/issues/37412/events
https://github.com/huggingface/transformers/pull/37412
2,984,906,269
PR_kwDOCUB6oc6SDxli
37,412
Quark Quantization gated repo
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-10T08:32:51
2025-04-10T12:57:17
2025-04-10T12:57:15
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37412", "html_url": "https://github.com/huggingface/transformers/pull/37412", "diff_url": "https://github.com/huggingface/transformers/pull/37412.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37412.patch", "merged_at": "2025-04-10T12:57:15" }
# What does this PR do? Fix the use of gated repo in quark quantization
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37412/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37412/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37411
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37411/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37411/comments
https://api.github.com/repos/huggingface/transformers/issues/37411/events
https://github.com/huggingface/transformers/pull/37411
2,984,568,664
PR_kwDOCUB6oc6SCoH8
37,411
Send trainer/fsdp/deepspeed CI job reports to a single channel
{ "login": "ydshieh", "id": 2521628, "node_id": "MDQ6VXNlcjI1MjE2Mjg=", "avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ydshieh", "html_url": "https://github.com/ydshieh", "followers_url": "https://api.github.com/users/ydshieh/followers", "following_url": "https://api.github.com/users/ydshieh/following{/other_user}", "gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}", "starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions", "organizations_url": "https://api.github.com/users/ydshieh/orgs", "repos_url": "https://api.github.com/users/ydshieh/repos", "events_url": "https://api.github.com/users/ydshieh/events{/privacy}", "received_events_url": "https://api.github.com/users/ydshieh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-10T06:11:00
2025-04-10T11:17:33
2025-04-10T11:17:31
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37411", "html_url": "https://github.com/huggingface/transformers/pull/37411", "diff_url": "https://github.com/huggingface/transformers/pull/37411.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37411.patch", "merged_at": "2025-04-10T11:17:31" }
# What does this PR do? As discussed offline with @SunMarc
{ "login": "ydshieh", "id": 2521628, "node_id": "MDQ6VXNlcjI1MjE2Mjg=", "avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ydshieh", "html_url": "https://github.com/ydshieh", "followers_url": "https://api.github.com/users/ydshieh/followers", "following_url": "https://api.github.com/users/ydshieh/following{/other_user}", "gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}", "starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions", "organizations_url": "https://api.github.com/users/ydshieh/orgs", "repos_url": "https://api.github.com/users/ydshieh/repos", "events_url": "https://api.github.com/users/ydshieh/events{/privacy}", "received_events_url": "https://api.github.com/users/ydshieh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37411/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37411/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37410
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37410/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37410/comments
https://api.github.com/repos/huggingface/transformers/issues/37410/events
https://github.com/huggingface/transformers/pull/37410
2,984,509,553
PR_kwDOCUB6oc6SCbWS
37,410
Add fuyu Fast Image Processor
{ "login": "Aravind-11", "id": 42345018, "node_id": "MDQ6VXNlcjQyMzQ1MDE4", "avatar_url": "https://avatars.githubusercontent.com/u/42345018?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Aravind-11", "html_url": "https://github.com/Aravind-11", "followers_url": "https://api.github.com/users/Aravind-11/followers", "following_url": "https://api.github.com/users/Aravind-11/following{/other_user}", "gists_url": "https://api.github.com/users/Aravind-11/gists{/gist_id}", "starred_url": "https://api.github.com/users/Aravind-11/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Aravind-11/subscriptions", "organizations_url": "https://api.github.com/users/Aravind-11/orgs", "repos_url": "https://api.github.com/users/Aravind-11/repos", "events_url": "https://api.github.com/users/Aravind-11/events{/privacy}", "received_events_url": "https://api.github.com/users/Aravind-11/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-10T05:31:48
2025-10-15T18:33:24
2025-08-01T16:22:07
CONTRIBUTOR
null
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37410", "html_url": "https://github.com/huggingface/transformers/pull/37410", "diff_url": "https://github.com/huggingface/transformers/pull/37410.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37410.patch", "merged_at": null }
# What does this PR do? This PR introduces `FuyuImageProcessorFast`, providing a faster alternative to the original `FuyuImageProcessor` by leveraging `torchvision` for image transformations. Key changes include: - Implementation of `FuyuImageProcessorFast` inheriting from `BaseImageProcessorFast`. - Adaptation of Fuyu-specific resize and padding logic using `torchvision.transforms.functional`. - Updates to `tests/models/fuyu/test_image_processing_fuyu.py` to include the fast processor, override save/load tests, and adjust tolerances for equivalence checks. All Fuyu image processing tests now pass. - Addition of documentation for `FuyuImageProcessorFast` and update of the main usage example to recommend `AutoProcessor` for loading. Fixes #36978 ## Before submitting - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? https://github.com/huggingface/transformers/issues/36978 - [x] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [x] Did you write any new necessary tests? ## Who can review? @yonigozlan
{ "login": "yonigozlan", "id": 74535834, "node_id": "MDQ6VXNlcjc0NTM1ODM0", "avatar_url": "https://avatars.githubusercontent.com/u/74535834?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yonigozlan", "html_url": "https://github.com/yonigozlan", "followers_url": "https://api.github.com/users/yonigozlan/followers", "following_url": "https://api.github.com/users/yonigozlan/following{/other_user}", "gists_url": "https://api.github.com/users/yonigozlan/gists{/gist_id}", "starred_url": "https://api.github.com/users/yonigozlan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yonigozlan/subscriptions", "organizations_url": "https://api.github.com/users/yonigozlan/orgs", "repos_url": "https://api.github.com/users/yonigozlan/repos", "events_url": "https://api.github.com/users/yonigozlan/events{/privacy}", "received_events_url": "https://api.github.com/users/yonigozlan/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37410/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37410/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37409
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37409/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37409/comments
https://api.github.com/repos/huggingface/transformers/issues/37409/events
https://github.com/huggingface/transformers/pull/37409
2,984,401,389
PR_kwDOCUB6oc6SCDu-
37,409
chore: standardize DeBERTa model card
{ "login": "Shoumik-Gandre", "id": 61053611, "node_id": "MDQ6VXNlcjYxMDUzNjEx", "avatar_url": "https://avatars.githubusercontent.com/u/61053611?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Shoumik-Gandre", "html_url": "https://github.com/Shoumik-Gandre", "followers_url": "https://api.github.com/users/Shoumik-Gandre/followers", "following_url": "https://api.github.com/users/Shoumik-Gandre/following{/other_user}", "gists_url": "https://api.github.com/users/Shoumik-Gandre/gists{/gist_id}", "starred_url": "https://api.github.com/users/Shoumik-Gandre/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Shoumik-Gandre/subscriptions", "organizations_url": "https://api.github.com/users/Shoumik-Gandre/orgs", "repos_url": "https://api.github.com/users/Shoumik-Gandre/repos", "events_url": "https://api.github.com/users/Shoumik-Gandre/events{/privacy}", "received_events_url": "https://api.github.com/users/Shoumik-Gandre/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-10T04:15:18
2025-08-11T17:30:38
2025-08-11T17:30:38
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37409", "html_url": "https://github.com/huggingface/transformers/pull/37409", "diff_url": "https://github.com/huggingface/transformers/pull/37409.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37409.patch", "merged_at": "2025-08-11T17:30:38" }
# What does this PR do? As suggested in this issue - https://github.com/huggingface/transformers/issues/36979#issue-2947704577 - this PR updates the documentation of the CLIP model, which will now be aligned with the standardized format for all the docs. <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> Fixes # (issue) ## Before submitting - [X] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [X] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [X] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. [[Issue link]](https://github.com/huggingface/transformers/issues/36979) - [X] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [X] Did you write any new necessary tests? Not required - Doc changes ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. @stevhliu please let me know if any changes are needed. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "stevhliu", "id": 59462357, "node_id": "MDQ6VXNlcjU5NDYyMzU3", "avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stevhliu", "html_url": "https://github.com/stevhliu", "followers_url": "https://api.github.com/users/stevhliu/followers", "following_url": "https://api.github.com/users/stevhliu/following{/other_user}", "gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}", "starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions", "organizations_url": "https://api.github.com/users/stevhliu/orgs", "repos_url": "https://api.github.com/users/stevhliu/repos", "events_url": "https://api.github.com/users/stevhliu/events{/privacy}", "received_events_url": "https://api.github.com/users/stevhliu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37409/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37409/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37408
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37408/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37408/comments
https://api.github.com/repos/huggingface/transformers/issues/37408/events
https://github.com/huggingface/transformers/issues/37408
2,984,394,345
I_kwDOCUB6oc6x4j5p
37,408
How to solve the error of converting Qwen onnx_model to tensorRT_model?
{ "login": "dearwind153", "id": 15264400, "node_id": "MDQ6VXNlcjE1MjY0NDAw", "avatar_url": "https://avatars.githubusercontent.com/u/15264400?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dearwind153", "html_url": "https://github.com/dearwind153", "followers_url": "https://api.github.com/users/dearwind153/followers", "following_url": "https://api.github.com/users/dearwind153/following{/other_user}", "gists_url": "https://api.github.com/users/dearwind153/gists{/gist_id}", "starred_url": "https://api.github.com/users/dearwind153/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dearwind153/subscriptions", "organizations_url": "https://api.github.com/users/dearwind153/orgs", "repos_url": "https://api.github.com/users/dearwind153/repos", "events_url": "https://api.github.com/users/dearwind153/events{/privacy}", "received_events_url": "https://api.github.com/users/dearwind153/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-10T04:08:47
2025-06-28T08:03:06
2025-06-28T08:03:06
NONE
null
null
null
null
### **1. The transformers' Qwen ONNX model has been exported successfully.** ### **2. Convert ONNX_model to tensorRT_model failed by trtexec.** **error info** ``` [04/10/2025-11:04:52] [E] Error[3]: IExecutionContext::setInputShape: Error Code 3: API Usage Error (Parameter check failed, condition: engineDims.d[i] == dims.d[i]. Static dimension mismatch while setting input shape for key_cache.1. Set dimensions are [7,8,32,128]. Expected dimensions are [7,8,1,128].) [04/10/2025-11:04:52] [E] The engine was built with static shapes for input tensor key_cache.1 but the provided shapes do not match the static shapes! [04/10/2025-11:04:52] [E] Inference set up failed ``` ### **Due to the fact that Qwen of Transoformers utilizes the DynamicCache class to handle KVcache, The error should be attributed to DynamicCache.** **### ONNX model check OK** ``` The model is well-formed and valid! =======================Model1 inputs: x_s [1, 'seq_len', 1024] attn_mask [1, 'seq_len', 'seq_len'] key_cache.1 [7, 8, 'seq_len', 128] value_cache.1 [7, 8, 'seq_len', 128] =======================Model1 outputs: y_pred [1, 'seq_len', 1024] key_cache [7, 8, 'seq_len', 128] value_cache [7, 8, 'seq_len', 128] ``` **export foward** ``` def injected_forward( self, xs: torch.Tensor, att_mask: torch.Tensor = torch.ones((0, 0, 0), dtype=torch.bool), key_cache: torch.Tensor = torch.zeros((0, 0, 0, 0), dtype=torch.float32), value_cache: torch.Tensor = torch.zeros((0, 0, 0, 0), dtype=torch.float32) ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: att_mask = ~att_mask.unsqueeze(1) * torch.finfo(xs.dtype).min past_key_values = DynamicCache(self.config.num_hidden_layers) for i in torch.arange(self.config.num_hidden_layers): past_key_values.key_cache[i] = key_cache[i].unsqueeze(0) past_key_values.value_cache[i] = value_cache[i].unsqueeze(0) past_seen_tokens = past_key_values.get_seq_length() cache_position = torch.arange(past_seen_tokens, past_seen_tokens + xs.shape[1], device=xs.device) position_ids = cache_position.unsqueeze(0) hidden_states = xs for decoder_layer in self.layers[: self.config.num_hidden_layers]: layer_outputs = decoder_layer( hidden_states, attention_mask=att_mask, position_ids=position_ids, past_key_value=past_key_values, output_attentions=False, use_cache=True, cache_position=cache_position, ) hidden_states = layer_outputs[0] xs = self.norm(hidden_states) new_key_cache = torch.cat(past_key_values.key_cache, dim=0) new_value_cache = torch.cat(past_key_values.value_cache, dim=0) return xs, new_key_cache, new_value_cache ```
{ "login": "github-actions[bot]", "id": 41898282, "node_id": "MDM6Qm90NDE4OTgyODI=", "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", "gravatar_id": "", "url": "https://api.github.com/users/github-actions%5Bbot%5D", "html_url": "https://github.com/apps/github-actions", "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37408/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37408/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37407
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37407/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37407/comments
https://api.github.com/repos/huggingface/transformers/issues/37407/events
https://github.com/huggingface/transformers/pull/37407
2,984,012,922
PR_kwDOCUB6oc6SAxMU
37,407
[Regression] Fix Quark quantized model loading after refactorization
{ "login": "BowenBao", "id": 9376104, "node_id": "MDQ6VXNlcjkzNzYxMDQ=", "avatar_url": "https://avatars.githubusercontent.com/u/9376104?v=4", "gravatar_id": "", "url": "https://api.github.com/users/BowenBao", "html_url": "https://github.com/BowenBao", "followers_url": "https://api.github.com/users/BowenBao/followers", "following_url": "https://api.github.com/users/BowenBao/following{/other_user}", "gists_url": "https://api.github.com/users/BowenBao/gists{/gist_id}", "starred_url": "https://api.github.com/users/BowenBao/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/BowenBao/subscriptions", "organizations_url": "https://api.github.com/users/BowenBao/orgs", "repos_url": "https://api.github.com/users/BowenBao/repos", "events_url": "https://api.github.com/users/BowenBao/events{/privacy}", "received_events_url": "https://api.github.com/users/BowenBao/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T22:14:10
2025-04-15T16:43:41
2025-04-11T11:43:36
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37407", "html_url": "https://github.com/huggingface/transformers/pull/37407", "diff_url": "https://github.com/huggingface/transformers/pull/37407.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37407.patch", "merged_at": "2025-04-11T11:43:36" }
# What does this PR do? Similar to #36702, #37136 and #37347. This PR provides a fix for Quark quantized model loading. ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @MekkCyber, @SunMarc, @Cyrilvallez cc @fxmarty-amd, @amd-xiaoyu12
{ "login": "SunMarc", "id": 57196510, "node_id": "MDQ6VXNlcjU3MTk2NTEw", "avatar_url": "https://avatars.githubusercontent.com/u/57196510?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SunMarc", "html_url": "https://github.com/SunMarc", "followers_url": "https://api.github.com/users/SunMarc/followers", "following_url": "https://api.github.com/users/SunMarc/following{/other_user}", "gists_url": "https://api.github.com/users/SunMarc/gists{/gist_id}", "starred_url": "https://api.github.com/users/SunMarc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SunMarc/subscriptions", "organizations_url": "https://api.github.com/users/SunMarc/orgs", "repos_url": "https://api.github.com/users/SunMarc/repos", "events_url": "https://api.github.com/users/SunMarc/events{/privacy}", "received_events_url": "https://api.github.com/users/SunMarc/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37407/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37407/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37406
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37406/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37406/comments
https://api.github.com/repos/huggingface/transformers/issues/37406/events
https://github.com/huggingface/transformers/pull/37406
2,983,982,256
PR_kwDOCUB6oc6SAqju
37,406
[`Flex Attn`] Fix torch 2.5.1 incompatibilities
{ "login": "vasqu", "id": 73884904, "node_id": "MDQ6VXNlcjczODg0OTA0", "avatar_url": "https://avatars.githubusercontent.com/u/73884904?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vasqu", "html_url": "https://github.com/vasqu", "followers_url": "https://api.github.com/users/vasqu/followers", "following_url": "https://api.github.com/users/vasqu/following{/other_user}", "gists_url": "https://api.github.com/users/vasqu/gists{/gist_id}", "starred_url": "https://api.github.com/users/vasqu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vasqu/subscriptions", "organizations_url": "https://api.github.com/users/vasqu/orgs", "repos_url": "https://api.github.com/users/vasqu/repos", "events_url": "https://api.github.com/users/vasqu/events{/privacy}", "received_events_url": "https://api.github.com/users/vasqu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T21:50:01
2025-06-26T16:32:47
2025-06-26T16:23:55
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37406", "html_url": "https://github.com/huggingface/transformers/pull/37406", "diff_url": "https://github.com/huggingface/transformers/pull/37406.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37406.patch", "merged_at": "2025-06-26T16:23:55" }
Flex attention with `torch==2.5.1` is broken, see e.g. https://github.com/huggingface/transformers/issues/37380#issuecomment-2790650478 The PR has 3 changes: 1. Removes the compilation on the block mask as it does not provide any major benefits in perf either way and seems to be the root cause behind the issues (torch 2.5.x specific). Open to making it version dependable but thought it's easier this way for now. 2. Change the mask padding to be not addition but up to a value, e.g. 4 -> 4 + 6 -> 10 (before) vs 4 -> 6 (after); unsure if this is breaking but seemed appropriate. Edit: changed this back to old behavior. 3. Mask padding goes to at least the value of the default block size in flex attention (can be observed on smaller seq_lens leading to indexing errors) (torch 2.5.x specific). # What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> Fixes # (issue) ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 --> cc @ArthurZucker @Cyrilvallez
{ "login": "vasqu", "id": 73884904, "node_id": "MDQ6VXNlcjczODg0OTA0", "avatar_url": "https://avatars.githubusercontent.com/u/73884904?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vasqu", "html_url": "https://github.com/vasqu", "followers_url": "https://api.github.com/users/vasqu/followers", "following_url": "https://api.github.com/users/vasqu/following{/other_user}", "gists_url": "https://api.github.com/users/vasqu/gists{/gist_id}", "starred_url": "https://api.github.com/users/vasqu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vasqu/subscriptions", "organizations_url": "https://api.github.com/users/vasqu/orgs", "repos_url": "https://api.github.com/users/vasqu/repos", "events_url": "https://api.github.com/users/vasqu/events{/privacy}", "received_events_url": "https://api.github.com/users/vasqu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37406/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37406/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37405
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37405/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37405/comments
https://api.github.com/repos/huggingface/transformers/issues/37405/events
https://github.com/huggingface/transformers/issues/37405
2,983,976,366
I_kwDOCUB6oc6x292u
37,405
Unable to load OLMo2 models with newer transformers versions
{ "login": "AkshitaB", "id": 6500683, "node_id": "MDQ6VXNlcjY1MDA2ODM=", "avatar_url": "https://avatars.githubusercontent.com/u/6500683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AkshitaB", "html_url": "https://github.com/AkshitaB", "followers_url": "https://api.github.com/users/AkshitaB/followers", "following_url": "https://api.github.com/users/AkshitaB/following{/other_user}", "gists_url": "https://api.github.com/users/AkshitaB/gists{/gist_id}", "starred_url": "https://api.github.com/users/AkshitaB/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AkshitaB/subscriptions", "organizations_url": "https://api.github.com/users/AkshitaB/orgs", "repos_url": "https://api.github.com/users/AkshitaB/repos", "events_url": "https://api.github.com/users/AkshitaB/events{/privacy}", "received_events_url": "https://api.github.com/users/AkshitaB/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-09T21:45:36
2025-06-12T15:52:58
2025-04-10T13:58:54
NONE
null
null
null
null
### System Info Fails on transformers versions: `4.50.3, 4.50.1, 4.50.0`. Works on 4.49.0 . Fails with ```raise ValueError( ValueError: Unrecognized model in allenai/OLMo-2-1124-7B. Should have a `model_type` key in its config.json, or contain one of the following strings in its name: albert, align, altclip, aria, aria_text, audio-spectrogram-transformer, autoformer, aya_vision, bamba, bark, bart, beit, bert, bert-generation, big_bird, bigbird_pegasus, biogpt, bit, blenderbot, blenderbot-small, blip, blip-2, bloom, bridgetower, bros, camembert, canine, chameleon, chinese_clip, chinese_clip_vision_model, clap, clip, clip_text_model, clip_vision_model, clipseg, clvp, code_llama, codegen, cohere, cohere2, colpali, conditional_detr, convbert, convnext, convnextv2, cpmant, ctrl, cvt, dab-detr, dac, data2vec-audio, data2vec-text, data2vec-vision, dbrx, deberta, deberta-v2, decision_transformer, deformable_detr, deit, depth_anything, depth_pro, deta, detr, diffllama, dinat, dinov2, dinov2_with_registers, distilbert, donut-swin, dpr, dpt, efficientformer, efficientnet, electra, emu3, encodec, encoder-decoder, ernie, ernie_m, esm, falcon, falcon_mamba, fastspeech2_conformer, flaubert, flava, fnet, focalnet, fsmt, funnel, fuyu, gemma, gemma2, gemma3, gemma3_text, git, glm, glpn, got_ocr2, gpt-sw3, gpt2, gpt_bigcode, gpt_neo, gpt_neox, gpt_neox_japanese, gptj, gptsan-japanese, granite, granitemoe, granitemoeshared, granitevision, graphormer, grounding-dino, groupvit, helium, hiera, hubert, ibert, idefics, idefics2, idefics3, idefics3_vision, ijepa, imagegpt, informer, instructblip, instructblipvideo, jamba, jetmoe, jukebox, kosmos-2, layoutlm, layoutlmv2, layoutlmv3, led, levit, lilt, llama, llava, llava_next, llava_next_video, llava_onevision, longformer, longt5, luke, lxmert, m2m_100, mamba, mamba2, marian, markuplm, mask2former, maskformer, maskformer-swin, mbart, mctct, mega, megatron-bert, mgp-str, mimi, mistral, mistral3, mixtral, mllama, mobilebert, mobilenet_v1, mobilenet_v2, mobilevit, mobilevitv2, modernbert, moonshine, moshi, mpnet, mpt, mra, mt5, musicgen, musicgen_melody, mvp, nat, nemotron, nezha, nllb-moe, nougat, nystromformer, olmo, olmo2, olmoe, omdet-turbo, oneformer, open-llama, openai-gpt, opt, owlv2, owlvit, paligemma, patchtsmixer, patchtst, pegasus, pegasus_x, perceiver, persimmon, phi, phi3, phimoe, pix2struct, pixtral, plbart, poolformer, pop2piano, prompt_depth_anything, prophetnet, pvt, pvt_v2, qdqbert, qwen2, qwen2_5_vl, qwen2_audio, qwen2_audio_encoder, qwen2_moe, qwen2_vl, rag, realm, recurrent_gemma, reformer, regnet, rembert, resnet, retribert, roberta, roberta-prelayernorm, roc_bert, roformer, rt_detr, rt_detr_resnet, rt_detr_v2, rwkv, sam, seamless_m4t, seamless_m4t_v2, segformer, seggpt, sew, sew-d, shieldgemma2, siglip, siglip2, siglip_vision_model, smolvlm, smolvlm_vision, speech-encoder-decoder, speech_to_text, speech_to_text_2, speecht5, splinter, squeezebert, stablelm, starcoder2, superglue, superpoint, swiftformer, swin, swin2sr, swinv2, switch_transformers, t5, table-transformer, tapas, textnet, time_series_transformer, timesformer, timm_backbone, timm_wrapper, trajectory_transformer, transfo-xl, trocr, tvlt, tvp, udop, umt5, unispeech, unispeech-sat, univnet, upernet, van, video_llava, videomae, vilt, vipllava, vision-encoder-decoder, vision-text-dual-encoder, visual_bert, vit, vit_hybrid, vit_mae, vit_msn, vitdet, vitmatte, vitpose, vitpose_backbone, vits, vivit, wav2vec2, wav2vec2-bert, wav2vec2-conformer, wavlm, whisper, xclip, xglm, xlm, xlm-prophetnet, xlm-roberta, xlm-roberta-xl, xlnet, xmod, yolos, yoso, zamba, zamba2, zoedepth``` Note that `olmo2` is present in the above list. ### Who can help? _No response_ ### Information - [ ] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction ```from transformers import AutoConfig config = AutoConfig.from_pretrained("allenai/OLMo-2-1124-7B")``` ### Expected behavior Config should be found and loaded
{ "login": "Rocketknight1", "id": 12866554, "node_id": "MDQ6VXNlcjEyODY2NTU0", "avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Rocketknight1", "html_url": "https://github.com/Rocketknight1", "followers_url": "https://api.github.com/users/Rocketknight1/followers", "following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}", "gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}", "starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions", "organizations_url": "https://api.github.com/users/Rocketknight1/orgs", "repos_url": "https://api.github.com/users/Rocketknight1/repos", "events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}", "received_events_url": "https://api.github.com/users/Rocketknight1/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37405/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37405/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37404
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37404/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37404/comments
https://api.github.com/repos/huggingface/transformers/issues/37404/events
https://github.com/huggingface/transformers/pull/37404
2,983,943,859
PR_kwDOCUB6oc6SAiMD
37,404
Explain tp_plan for FBgemm
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T21:22:23
2025-04-10T09:33:35
2025-04-10T09:33:33
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37404", "html_url": "https://github.com/huggingface/transformers/pull/37404", "diff_url": "https://github.com/huggingface/transformers/pull/37404.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37404.patch", "merged_at": "2025-04-10T09:33:33" }
# What does this PR do? Explains the tp_plan for fbgemm implementation
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37404/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37404/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37403
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37403/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37403/comments
https://api.github.com/repos/huggingface/transformers/issues/37403/events
https://github.com/huggingface/transformers/pull/37403
2,983,943,502
PR_kwDOCUB6oc6SAiG8
37,403
Fix: compute cache_position correctly when inputs_embeds are used dur…
{ "login": "ceyzaguirre4", "id": 20346844, "node_id": "MDQ6VXNlcjIwMzQ2ODQ0", "avatar_url": "https://avatars.githubusercontent.com/u/20346844?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ceyzaguirre4", "html_url": "https://github.com/ceyzaguirre4", "followers_url": "https://api.github.com/users/ceyzaguirre4/followers", "following_url": "https://api.github.com/users/ceyzaguirre4/following{/other_user}", "gists_url": "https://api.github.com/users/ceyzaguirre4/gists{/gist_id}", "starred_url": "https://api.github.com/users/ceyzaguirre4/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ceyzaguirre4/subscriptions", "organizations_url": "https://api.github.com/users/ceyzaguirre4/orgs", "repos_url": "https://api.github.com/users/ceyzaguirre4/repos", "events_url": "https://api.github.com/users/ceyzaguirre4/events{/privacy}", "received_events_url": "https://api.github.com/users/ceyzaguirre4/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T21:22:09
2025-04-09T23:17:14
2025-04-09T23:17:14
NONE
null
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37403", "html_url": "https://github.com/huggingface/transformers/pull/37403", "diff_url": "https://github.com/huggingface/transformers/pull/37403.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37403.patch", "merged_at": null }
…ing generation with past_key_values Fix: compute cache_position correctly when inputs_embeds are used during generation with past_key_values When using inputs_embeds in place of input_ids during incremental generation, the current logic incorrectly initializes cache_position from inputs_embeds alone, which causes incorrect slicing or empty position tensors when past_key_values are present. This patch initializes cache_position as torch.arange(past_length, past_length + seq_len), ensuring correct rotary embedding alignment. # What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> Fixes # (issue) ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "ceyzaguirre4", "id": 20346844, "node_id": "MDQ6VXNlcjIwMzQ2ODQ0", "avatar_url": "https://avatars.githubusercontent.com/u/20346844?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ceyzaguirre4", "html_url": "https://github.com/ceyzaguirre4", "followers_url": "https://api.github.com/users/ceyzaguirre4/followers", "following_url": "https://api.github.com/users/ceyzaguirre4/following{/other_user}", "gists_url": "https://api.github.com/users/ceyzaguirre4/gists{/gist_id}", "starred_url": "https://api.github.com/users/ceyzaguirre4/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ceyzaguirre4/subscriptions", "organizations_url": "https://api.github.com/users/ceyzaguirre4/orgs", "repos_url": "https://api.github.com/users/ceyzaguirre4/repos", "events_url": "https://api.github.com/users/ceyzaguirre4/events{/privacy}", "received_events_url": "https://api.github.com/users/ceyzaguirre4/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37403/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37403/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37402
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37402/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37402/comments
https://api.github.com/repos/huggingface/transformers/issues/37402/events
https://github.com/huggingface/transformers/pull/37402
2,983,844,524
PR_kwDOCUB6oc6SAMc1
37,402
[flax/mistral] support sliding_window: null in config
{ "login": "yiding", "id": 240535, "node_id": "MDQ6VXNlcjI0MDUzNQ==", "avatar_url": "https://avatars.githubusercontent.com/u/240535?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yiding", "html_url": "https://github.com/yiding", "followers_url": "https://api.github.com/users/yiding/followers", "following_url": "https://api.github.com/users/yiding/following{/other_user}", "gists_url": "https://api.github.com/users/yiding/gists{/gist_id}", "starred_url": "https://api.github.com/users/yiding/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yiding/subscriptions", "organizations_url": "https://api.github.com/users/yiding/orgs", "repos_url": "https://api.github.com/users/yiding/repos", "events_url": "https://api.github.com/users/yiding/events{/privacy}", "received_events_url": "https://api.github.com/users/yiding/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 2934977194, "node_id": "MDU6TGFiZWwyOTM0OTc3MTk0", "url": "https://api.github.com/repos/huggingface/transformers/labels/Flax", "name": "Flax", "color": "4862AD", "default": false, "description": "" } ]
closed
false
null
[]
null
[]
2025-04-09T20:25:56
2025-06-02T14:45:02
2025-06-02T14:45:02
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37402", "html_url": "https://github.com/huggingface/transformers/pull/37402", "diff_url": "https://github.com/huggingface/transformers/pull/37402.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37402.patch", "merged_at": "2025-06-02T14:45:02" }
# What does this PR do? Adds support for `sliding_window: null` in FlaxMistral llm models. This is needed for models like Mistral-small. The corresponding pytorch model code already supports this. # Before Submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [X] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @ArthurZucker @kiansierra
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37402/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37402/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37401
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37401/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37401/comments
https://api.github.com/repos/huggingface/transformers/issues/37401/events
https://github.com/huggingface/transformers/pull/37401
2,983,794,323
PR_kwDOCUB6oc6SABef
37,401
Offloaded hybrid cache for Llama4
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T20:02:46
2025-04-10T09:44:36
2025-04-10T09:44:34
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37401", "html_url": "https://github.com/huggingface/transformers/pull/37401", "diff_url": "https://github.com/huggingface/transformers/pull/37401.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37401.patch", "merged_at": "2025-04-10T09:44:34" }
# What does this PR do? As per the title.
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37401/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37401/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37400
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37400/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37400/comments
https://api.github.com/repos/huggingface/transformers/issues/37400/events
https://github.com/huggingface/transformers/pull/37400
2,983,786,101
PR_kwDOCUB6oc6R__lc
37,400
Handle torch ver in flexattn
{ "login": "Kh4L", "id": 3193578, "node_id": "MDQ6VXNlcjMxOTM1Nzg=", "avatar_url": "https://avatars.githubusercontent.com/u/3193578?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Kh4L", "html_url": "https://github.com/Kh4L", "followers_url": "https://api.github.com/users/Kh4L/followers", "following_url": "https://api.github.com/users/Kh4L/following{/other_user}", "gists_url": "https://api.github.com/users/Kh4L/gists{/gist_id}", "starred_url": "https://api.github.com/users/Kh4L/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Kh4L/subscriptions", "organizations_url": "https://api.github.com/users/Kh4L/orgs", "repos_url": "https://api.github.com/users/Kh4L/repos", "events_url": "https://api.github.com/users/Kh4L/events{/privacy}", "received_events_url": "https://api.github.com/users/Kh4L/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T20:00:33
2025-04-10T09:27:54
2025-04-10T09:27:54
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37400", "html_url": "https://github.com/huggingface/transformers/pull/37400", "diff_url": "https://github.com/huggingface/transformers/pull/37400.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37400.patch", "merged_at": "2025-04-10T09:27:54" }
Follow up #37399 @ArthurZucker
{ "login": "SunMarc", "id": 57196510, "node_id": "MDQ6VXNlcjU3MTk2NTEw", "avatar_url": "https://avatars.githubusercontent.com/u/57196510?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SunMarc", "html_url": "https://github.com/SunMarc", "followers_url": "https://api.github.com/users/SunMarc/followers", "following_url": "https://api.github.com/users/SunMarc/following{/other_user}", "gists_url": "https://api.github.com/users/SunMarc/gists{/gist_id}", "starred_url": "https://api.github.com/users/SunMarc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SunMarc/subscriptions", "organizations_url": "https://api.github.com/users/SunMarc/orgs", "repos_url": "https://api.github.com/users/SunMarc/repos", "events_url": "https://api.github.com/users/SunMarc/events{/privacy}", "received_events_url": "https://api.github.com/users/SunMarc/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37400/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37400/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37399
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37399/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37399/comments
https://api.github.com/repos/huggingface/transformers/issues/37399/events
https://github.com/huggingface/transformers/pull/37399
2,983,714,815
PR_kwDOCUB6oc6R_wA8
37,399
handle torch version edge cases
{ "login": "winglian", "id": 381258, "node_id": "MDQ6VXNlcjM4MTI1OA==", "avatar_url": "https://avatars.githubusercontent.com/u/381258?v=4", "gravatar_id": "", "url": "https://api.github.com/users/winglian", "html_url": "https://github.com/winglian", "followers_url": "https://api.github.com/users/winglian/followers", "following_url": "https://api.github.com/users/winglian/following{/other_user}", "gists_url": "https://api.github.com/users/winglian/gists{/gist_id}", "starred_url": "https://api.github.com/users/winglian/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/winglian/subscriptions", "organizations_url": "https://api.github.com/users/winglian/orgs", "repos_url": "https://api.github.com/users/winglian/repos", "events_url": "https://api.github.com/users/winglian/events{/privacy}", "received_events_url": "https://api.github.com/users/winglian/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T19:27:47
2025-04-09T20:04:23
2025-04-09T19:49:57
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37399", "html_url": "https://github.com/huggingface/transformers/pull/37399", "diff_url": "https://github.com/huggingface/transformers/pull/37399.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37399.patch", "merged_at": "2025-04-09T19:49:57" }
# What does this PR do? If torch is installed as `torch==2.6.0+cu126`, then this check fails to detect it as 2.6.0 ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @ArthurZucker @SunMarc Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37399/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37399/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37398
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37398/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37398/comments
https://api.github.com/repos/huggingface/transformers/issues/37398/events
https://github.com/huggingface/transformers/pull/37398
2,983,432,586
PR_kwDOCUB6oc6R-ycq
37,398
Add usage example for DINOv2
{ "login": "baldassarreFe", "id": 13353649, "node_id": "MDQ6VXNlcjEzMzUzNjQ5", "avatar_url": "https://avatars.githubusercontent.com/u/13353649?v=4", "gravatar_id": "", "url": "https://api.github.com/users/baldassarreFe", "html_url": "https://github.com/baldassarreFe", "followers_url": "https://api.github.com/users/baldassarreFe/followers", "following_url": "https://api.github.com/users/baldassarreFe/following{/other_user}", "gists_url": "https://api.github.com/users/baldassarreFe/gists{/gist_id}", "starred_url": "https://api.github.com/users/baldassarreFe/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/baldassarreFe/subscriptions", "organizations_url": "https://api.github.com/users/baldassarreFe/orgs", "repos_url": "https://api.github.com/users/baldassarreFe/repos", "events_url": "https://api.github.com/users/baldassarreFe/events{/privacy}", "received_events_url": "https://api.github.com/users/baldassarreFe/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T17:19:23
2025-05-02T20:25:10
2025-05-01T15:54:22
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37398", "html_url": "https://github.com/huggingface/transformers/pull/37398", "diff_url": "https://github.com/huggingface/transformers/pull/37398.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37398.patch", "merged_at": "2025-05-01T15:54:22" }
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> Add an usage example for DINOv2. Before this, it was not clear what the output of the model represents. The example shows how to separate the CLS token and how to reshape PATCH tokens into a feature map. It's not much, but it's honest work :D ## Before submitting - [x] 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. @amyeroberts, @qubvel, @stevhliu <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "stevhliu", "id": 59462357, "node_id": "MDQ6VXNlcjU5NDYyMzU3", "avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stevhliu", "html_url": "https://github.com/stevhliu", "followers_url": "https://api.github.com/users/stevhliu/followers", "following_url": "https://api.github.com/users/stevhliu/following{/other_user}", "gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}", "starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions", "organizations_url": "https://api.github.com/users/stevhliu/orgs", "repos_url": "https://api.github.com/users/stevhliu/repos", "events_url": "https://api.github.com/users/stevhliu/events{/privacy}", "received_events_url": "https://api.github.com/users/stevhliu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37398/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37398/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37397
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37397/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37397/comments
https://api.github.com/repos/huggingface/transformers/issues/37397/events
https://github.com/huggingface/transformers/pull/37397
2,983,432,562
PR_kwDOCUB6oc6R-ycS
37,397
Add support for Moonlight 16B, add aux loss for Deepseek v3 model finetuning.
{ "login": "Kimiko-AI", "id": 105905988, "node_id": "U_kgDOBk__RA", "avatar_url": "https://avatars.githubusercontent.com/u/105905988?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Kimiko-AI", "html_url": "https://github.com/Kimiko-AI", "followers_url": "https://api.github.com/users/Kimiko-AI/followers", "following_url": "https://api.github.com/users/Kimiko-AI/following{/other_user}", "gists_url": "https://api.github.com/users/Kimiko-AI/gists{/gist_id}", "starred_url": "https://api.github.com/users/Kimiko-AI/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Kimiko-AI/subscriptions", "organizations_url": "https://api.github.com/users/Kimiko-AI/orgs", "repos_url": "https://api.github.com/users/Kimiko-AI/repos", "events_url": "https://api.github.com/users/Kimiko-AI/events{/privacy}", "received_events_url": "https://api.github.com/users/Kimiko-AI/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 1843244711, "node_id": "MDU6TGFiZWwxODQzMjQ0NzEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/New%20model", "name": "New model", "color": "fbca04", "default": false, "description": "" } ]
open
false
null
[]
null
[]
2025-04-09T17:19:23
2025-04-19T05:10:48
null
NONE
null
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37397", "html_url": "https://github.com/huggingface/transformers/pull/37397", "diff_url": "https://github.com/huggingface/transformers/pull/37397.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37397.patch", "merged_at": null }
# What does this PR do? This add support for moonlight 16B which uses q_lora_rank = null, add sequence-wise auxiliary loss proposed in deepseek v3 paper and this [reimplemtation ](https://github.com/ScienceOne-AI/DeepSeek-671B-SFT-Guide/blob/main/model/DeepSeek-R1-BF16/modeling_deepseek.py) ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] I read the contributor guideline, Pull Request section @ArthurZucker
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37397/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37397/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/37396
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37396/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37396/comments
https://api.github.com/repos/huggingface/transformers/issues/37396/events
https://github.com/huggingface/transformers/pull/37396
2,983,429,980
PR_kwDOCUB6oc6R-x38
37,396
Next batch of models with removed return_dict
{ "login": "qubvel", "id": 31920396, "node_id": "MDQ6VXNlcjMxOTIwMzk2", "avatar_url": "https://avatars.githubusercontent.com/u/31920396?v=4", "gravatar_id": "", "url": "https://api.github.com/users/qubvel", "html_url": "https://github.com/qubvel", "followers_url": "https://api.github.com/users/qubvel/followers", "following_url": "https://api.github.com/users/qubvel/following{/other_user}", "gists_url": "https://api.github.com/users/qubvel/gists{/gist_id}", "starred_url": "https://api.github.com/users/qubvel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/qubvel/subscriptions", "organizations_url": "https://api.github.com/users/qubvel/orgs", "repos_url": "https://api.github.com/users/qubvel/repos", "events_url": "https://api.github.com/users/qubvel/events{/privacy}", "received_events_url": "https://api.github.com/users/qubvel/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-04-09T17:18:10
2025-04-18T16:56:46
null
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37396", "html_url": "https://github.com/huggingface/transformers/pull/37396", "diff_url": "https://github.com/huggingface/transformers/pull/37396.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37396.patch", "merged_at": null }
# What does this PR do? Continue removing the `return_dict` attribute from the modeling code.
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37396/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37396/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/37395
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37395/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37395/comments
https://api.github.com/repos/huggingface/transformers/issues/37395/events
https://github.com/huggingface/transformers/pull/37395
2,983,426,680
PR_kwDOCUB6oc6R-xJY
37,395
Add warning when failed to acquire other user's lock at model download
{ "login": "manueldeprada", "id": 6536835, "node_id": "MDQ6VXNlcjY1MzY4MzU=", "avatar_url": "https://avatars.githubusercontent.com/u/6536835?v=4", "gravatar_id": "", "url": "https://api.github.com/users/manueldeprada", "html_url": "https://github.com/manueldeprada", "followers_url": "https://api.github.com/users/manueldeprada/followers", "following_url": "https://api.github.com/users/manueldeprada/following{/other_user}", "gists_url": "https://api.github.com/users/manueldeprada/gists{/gist_id}", "starred_url": "https://api.github.com/users/manueldeprada/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/manueldeprada/subscriptions", "organizations_url": "https://api.github.com/users/manueldeprada/orgs", "repos_url": "https://api.github.com/users/manueldeprada/repos", "events_url": "https://api.github.com/users/manueldeprada/events{/privacy}", "received_events_url": "https://api.github.com/users/manueldeprada/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T17:16:34
2025-04-10T09:18:43
2025-04-10T09:18:27
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37395", "html_url": "https://github.com/huggingface/transformers/pull/37395", "diff_url": "https://github.com/huggingface/transformers/pull/37395.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37395.patch", "merged_at": "2025-04-10T09:18:27" }
In cache directories that are shared between multiple users, it is common that a user starts downloading a model but gets tired and kills the process. This leaves the folder structure and their own locks on the filesystem. If another user comes later and tries to use the same model, the loading will fail with a cryptic message: ```bash OSError: meta-llama/Llama-3.1-8B-Instruct does not appear to have a file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt or flax_model.msgpack ``` What is happening under the hood is that it failed to acquire the lock, catches the exception, leaves no trace, then tries to recover here: https://github.com/huggingface/transformers/blob/f834ca2c19215f1e4fb0959cc3faafeaf56cd4f7/src/transformers/utils/hub.py#L453C4-L472C10 Since it fails to find the files, the user gets the confusing OSError. This PR just adds proper error handling to make clear what is happening, so that they know they can manually delete the locks. I don't think we should catch the exception and delete the locks ourselves, since the other user might be actually downloading the file, and UNIX locks are not shareable. ## Who can review? @gante
{ "login": "manueldeprada", "id": 6536835, "node_id": "MDQ6VXNlcjY1MzY4MzU=", "avatar_url": "https://avatars.githubusercontent.com/u/6536835?v=4", "gravatar_id": "", "url": "https://api.github.com/users/manueldeprada", "html_url": "https://github.com/manueldeprada", "followers_url": "https://api.github.com/users/manueldeprada/followers", "following_url": "https://api.github.com/users/manueldeprada/following{/other_user}", "gists_url": "https://api.github.com/users/manueldeprada/gists{/gist_id}", "starred_url": "https://api.github.com/users/manueldeprada/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/manueldeprada/subscriptions", "organizations_url": "https://api.github.com/users/manueldeprada/orgs", "repos_url": "https://api.github.com/users/manueldeprada/repos", "events_url": "https://api.github.com/users/manueldeprada/events{/privacy}", "received_events_url": "https://api.github.com/users/manueldeprada/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37395/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37395/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37394
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37394/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37394/comments
https://api.github.com/repos/huggingface/transformers/issues/37394/events
https://github.com/huggingface/transformers/pull/37394
2,983,342,563
PR_kwDOCUB6oc6R-fAx
37,394
[Cache] Support compilable cache reuse with smaller batch sizes
{ "login": "gante", "id": 12240844, "node_id": "MDQ6VXNlcjEyMjQwODQ0", "avatar_url": "https://avatars.githubusercontent.com/u/12240844?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gante", "html_url": "https://github.com/gante", "followers_url": "https://api.github.com/users/gante/followers", "following_url": "https://api.github.com/users/gante/following{/other_user}", "gists_url": "https://api.github.com/users/gante/gists{/gist_id}", "starred_url": "https://api.github.com/users/gante/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gante/subscriptions", "organizations_url": "https://api.github.com/users/gante/orgs", "repos_url": "https://api.github.com/users/gante/repos", "events_url": "https://api.github.com/users/gante/events{/privacy}", "received_events_url": "https://api.github.com/users/gante/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T16:35:42
2025-08-12T15:33:42
2025-08-12T15:33:42
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37394", "html_url": "https://github.com/huggingface/transformers/pull/37394", "diff_url": "https://github.com/huggingface/transformers/pull/37394.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37394.patch", "merged_at": null }
# What does this PR do? ⚠️ this PR needs to be rebased, don't review/merge Supercedes #37389 Partially solves #35444 This PR makes our `max_cache_size` argument in compilable caches finally true: we can now use a cache object with a batch size smaller than the one defined in the cache. Compile once and run with multiple input shapes -- particularly useful for export, as mentioned in #35444. Adds other minor related fixes (see PR comments). __________________ We can see in the following test script that this does not degrade compiled performance: ```py from transformers import AutoModelForCausalLM, AutoTokenizer, StaticCache import torch import time tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B") model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B", device_map="auto", torch_dtype=torch.float16) input_ids = tokenizer(["The quick brown"], return_tensors="pt").input_ids.to(model.device) cache_position = torch.arange(input_ids.shape[1]).to(model.device) with torch.no_grad(): #------------------------------------------------------------------------------------------------ # OLD, cache batch size = input batch size # Measured on an RTX 4090: `main` = 0.223ms; this PR = 0.223ms cache = StaticCache( config=model.config, max_batch_size=1, max_cache_len=100, device=model.device, dtype=model.dtype ) model.forward = torch.compile(model.forward, fullgraph=True, mode="reduce-overhead") # warmup for _ in range(3): outputs = model(input_ids, cache_position=cache_position, past_key_values=cache) # measure start = time.time() for _ in range(100): outputs = model(input_ids, cache_position=cache_position, past_key_values=cache) end = time.time() print(f"[Old] Average time taken: {((end - start) / 100) * 1000} ms") #------------------------------------------------------------------------------------------------ # clear torch compile cache torch._dynamo.reset() #------------------------------------------------------------------------------------------------ # NEW, cache batch size > input batch size # Measured on an RTX 4090: `main` = Doesn't work; this PR = 0.224ms cache = StaticCache( config=model.config, max_batch_size=16, # 16 >> 1 max_cache_len=100, device=model.device, dtype=model.dtype ) model.forward = torch.compile(model.forward, fullgraph=True, mode="reduce-overhead") # warmup for _ in range(3): outputs = model(input_ids, cache_position=cache_position, past_key_values=cache) # measure start = time.time() for _ in range(100): outputs = model(input_ids, cache_position=cache_position, past_key_values=cache) end = time.time() print(f"[New] Average time taken: {((end - start) / 100) * 1000} ms") ```
{ "login": "gante", "id": 12240844, "node_id": "MDQ6VXNlcjEyMjQwODQ0", "avatar_url": "https://avatars.githubusercontent.com/u/12240844?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gante", "html_url": "https://github.com/gante", "followers_url": "https://api.github.com/users/gante/followers", "following_url": "https://api.github.com/users/gante/following{/other_user}", "gists_url": "https://api.github.com/users/gante/gists{/gist_id}", "starred_url": "https://api.github.com/users/gante/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gante/subscriptions", "organizations_url": "https://api.github.com/users/gante/orgs", "repos_url": "https://api.github.com/users/gante/repos", "events_url": "https://api.github.com/users/gante/events{/privacy}", "received_events_url": "https://api.github.com/users/gante/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37394/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37394/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37393
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37393/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37393/comments
https://api.github.com/repos/huggingface/transformers/issues/37393/events
https://github.com/huggingface/transformers/pull/37393
2,982,677,825
PR_kwDOCUB6oc6R8NFu
37,393
Add AutoRound quantization support
{ "login": "wenhuach21", "id": 108330088, "node_id": "U_kgDOBnT8aA", "avatar_url": "https://avatars.githubusercontent.com/u/108330088?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wenhuach21", "html_url": "https://github.com/wenhuach21", "followers_url": "https://api.github.com/users/wenhuach21/followers", "following_url": "https://api.github.com/users/wenhuach21/following{/other_user}", "gists_url": "https://api.github.com/users/wenhuach21/gists{/gist_id}", "starred_url": "https://api.github.com/users/wenhuach21/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wenhuach21/subscriptions", "organizations_url": "https://api.github.com/users/wenhuach21/orgs", "repos_url": "https://api.github.com/users/wenhuach21/repos", "events_url": "https://api.github.com/users/wenhuach21/events{/privacy}", "received_events_url": "https://api.github.com/users/wenhuach21/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T12:30:57
2025-04-22T11:56:54
2025-04-22T11:56:54
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37393", "html_url": "https://github.com/huggingface/transformers/pull/37393", "diff_url": "https://github.com/huggingface/transformers/pull/37393.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37393.patch", "merged_at": "2025-04-22T11:56:54" }
This PR is intended to add support for AutoRound quantizer to the transformers library. Paper https://arxiv.org/abs/2309.05516 Git https://github.com/intel/auto-round
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37393/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37393/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37392
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37392/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37392/comments
https://api.github.com/repos/huggingface/transformers/issues/37392/events
https://github.com/huggingface/transformers/pull/37392
2,982,656,373
PR_kwDOCUB6oc6R8IWN
37,392
Add Encoder-only Mask Transformer (EoMT) (except integration test(s), pre- and post- processing and training code)
{ "login": "tommiekerssies", "id": 6392002, "node_id": "MDQ6VXNlcjYzOTIwMDI=", "avatar_url": "https://avatars.githubusercontent.com/u/6392002?v=4", "gravatar_id": "", "url": "https://api.github.com/users/tommiekerssies", "html_url": "https://github.com/tommiekerssies", "followers_url": "https://api.github.com/users/tommiekerssies/followers", "following_url": "https://api.github.com/users/tommiekerssies/following{/other_user}", "gists_url": "https://api.github.com/users/tommiekerssies/gists{/gist_id}", "starred_url": "https://api.github.com/users/tommiekerssies/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tommiekerssies/subscriptions", "organizations_url": "https://api.github.com/users/tommiekerssies/orgs", "repos_url": "https://api.github.com/users/tommiekerssies/repos", "events_url": "https://api.github.com/users/tommiekerssies/events{/privacy}", "received_events_url": "https://api.github.com/users/tommiekerssies/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 1843244711, "node_id": "MDU6TGFiZWwxODQzMjQ0NzEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/New%20model", "name": "New model", "color": "fbca04", "default": false, "description": "" }, { "id": 2392046359, "node_id": "MDU6TGFiZWwyMzkyMDQ2MzU5", "url": "https://api.github.com/repos/huggingface/transformers/labels/Good%20Second%20Issue", "name": "Good Second Issue", "color": "dd935a", "default": false, "description": "Issues that are more difficult to do than \"Good First\" issues - give it a try if you want!" }, { "id": 5769473378, "node_id": "LA_kwDOCUB6oc8AAAABV-MtYg", "url": "https://api.github.com/repos/huggingface/transformers/labels/Vision", "name": "Vision", "color": "C079EF", "default": false, "description": "" }, { "id": 6126880899, "node_id": "LA_kwDOCUB6oc8AAAABbTDIgw", "url": "https://api.github.com/repos/huggingface/transformers/labels/contributions-welcome", "name": "contributions-welcome", "color": "F99E09", "default": false, "description": "" } ]
closed
false
null
[]
null
[]
2025-04-09T12:22:34
2025-07-01T10:28:23
2025-07-01T10:28:23
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37392", "html_url": "https://github.com/huggingface/transformers/pull/37392", "diff_url": "https://github.com/huggingface/transformers/pull/37392.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37392.patch", "merged_at": null }
See https://github.com/huggingface/transformers/issues/37171 As stated in the title, the integration test is still needed. The pre- and post- processing and training code is preferably for a later PR.
{ "login": "qubvel", "id": 31920396, "node_id": "MDQ6VXNlcjMxOTIwMzk2", "avatar_url": "https://avatars.githubusercontent.com/u/31920396?v=4", "gravatar_id": "", "url": "https://api.github.com/users/qubvel", "html_url": "https://github.com/qubvel", "followers_url": "https://api.github.com/users/qubvel/followers", "following_url": "https://api.github.com/users/qubvel/following{/other_user}", "gists_url": "https://api.github.com/users/qubvel/gists{/gist_id}", "starred_url": "https://api.github.com/users/qubvel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/qubvel/subscriptions", "organizations_url": "https://api.github.com/users/qubvel/orgs", "repos_url": "https://api.github.com/users/qubvel/repos", "events_url": "https://api.github.com/users/qubvel/events{/privacy}", "received_events_url": "https://api.github.com/users/qubvel/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37392/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 1, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37392/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37391
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37391/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37391/comments
https://api.github.com/repos/huggingface/transformers/issues/37391/events
https://github.com/huggingface/transformers/pull/37391
2,982,500,710
PR_kwDOCUB6oc6R7ng1
37,391
Model debugger upgrades
{ "login": "molbap", "id": 39954772, "node_id": "MDQ6VXNlcjM5OTU0Nzcy", "avatar_url": "https://avatars.githubusercontent.com/u/39954772?v=4", "gravatar_id": "", "url": "https://api.github.com/users/molbap", "html_url": "https://github.com/molbap", "followers_url": "https://api.github.com/users/molbap/followers", "following_url": "https://api.github.com/users/molbap/following{/other_user}", "gists_url": "https://api.github.com/users/molbap/gists{/gist_id}", "starred_url": "https://api.github.com/users/molbap/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/molbap/subscriptions", "organizations_url": "https://api.github.com/users/molbap/orgs", "repos_url": "https://api.github.com/users/molbap/repos", "events_url": "https://api.github.com/users/molbap/events{/privacy}", "received_events_url": "https://api.github.com/users/molbap/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T11:21:16
2025-04-28T13:14:19
2025-04-18T14:45:54
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37391", "html_url": "https://github.com/huggingface/transformers/pull/37391", "diff_url": "https://github.com/huggingface/transformers/pull/37391.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37391.patch", "merged_at": "2025-04-18T14:45:54" }
# What does this PR do? A continuation of #36798 , now: - The debugger will only output the first and last layer of a sequence of layers. - mean/stds are added as well, and a `..._SUMMARY.json` file will contain only statistics, not full tensors. - General printing improvements.
{ "login": "molbap", "id": 39954772, "node_id": "MDQ6VXNlcjM5OTU0Nzcy", "avatar_url": "https://avatars.githubusercontent.com/u/39954772?v=4", "gravatar_id": "", "url": "https://api.github.com/users/molbap", "html_url": "https://github.com/molbap", "followers_url": "https://api.github.com/users/molbap/followers", "following_url": "https://api.github.com/users/molbap/following{/other_user}", "gists_url": "https://api.github.com/users/molbap/gists{/gist_id}", "starred_url": "https://api.github.com/users/molbap/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/molbap/subscriptions", "organizations_url": "https://api.github.com/users/molbap/orgs", "repos_url": "https://api.github.com/users/molbap/repos", "events_url": "https://api.github.com/users/molbap/events{/privacy}", "received_events_url": "https://api.github.com/users/molbap/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37391/reactions", "total_count": 3, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 3, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37391/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37390
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37390/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37390/comments
https://api.github.com/repos/huggingface/transformers/issues/37390/events
https://github.com/huggingface/transformers/issues/37390
2,982,413,042
I_kwDOCUB6oc6xxALy
37,390
how to reduce original model's tokenizer vocabulary
{ "login": "masterwang22327", "id": 87161022, "node_id": "MDQ6VXNlcjg3MTYxMDIy", "avatar_url": "https://avatars.githubusercontent.com/u/87161022?v=4", "gravatar_id": "", "url": "https://api.github.com/users/masterwang22327", "html_url": "https://github.com/masterwang22327", "followers_url": "https://api.github.com/users/masterwang22327/followers", "following_url": "https://api.github.com/users/masterwang22327/following{/other_user}", "gists_url": "https://api.github.com/users/masterwang22327/gists{/gist_id}", "starred_url": "https://api.github.com/users/masterwang22327/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/masterwang22327/subscriptions", "organizations_url": "https://api.github.com/users/masterwang22327/orgs", "repos_url": "https://api.github.com/users/masterwang22327/repos", "events_url": "https://api.github.com/users/masterwang22327/events{/privacy}", "received_events_url": "https://api.github.com/users/masterwang22327/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 2648621985, "node_id": "MDU6TGFiZWwyNjQ4NjIxOTg1", "url": "https://api.github.com/repos/huggingface/transformers/labels/Feature%20request", "name": "Feature request", "color": "FBCA04", "default": false, "description": "Request for a new feature" } ]
open
false
null
[]
null
[]
2025-04-09T10:45:56
2025-04-09T10:53:07
null
NONE
null
null
null
null
`###` Feature request I am working on model distillation. I am currently using the nllb-distilled-600M model, but the parameters of this model are still too large, and the vocabulary supports more than 100 languages. My use case is single language translation, such as English to Hebrew. Therefore, I need to reduce the redundant vocabulary of the original model and only keep the English and Hebrew vocabulary. I noticed that transformers do not use the sentencepiece.bpe.model file, and I don't want to retrain a tokenizer, because the trained tokenizer will be inconsistent with the original tokenizer result, which will lead to the subsequent model weight migration and model distillation process cannot be carried out. Therefore, my idea is to quickly replace the tokenizer.json and tokenizer_config.json files in the original model, and then migrate the model weights at the model level to get a pruned model. What I am doing now is to load the original model tokenizer, tokenize the corpus I prepared, count the registered tokens, regain a reduced vocabulary, and change the corresponding json file. Is there any better strategy to quickly replace the tokenizer vocabulary? ![Image](https://github.com/user-attachments/assets/0433f4df-766d-4804-a752-e02a104d3cfa) ### Motivation quick modify model vocabulary for beater application ### Your contribution > `def modify_tokenizer(): for sentences in tqdm.tqdm(range(100,len(en_corpus),100)): enc = teacher_tokenizer(en_corpus[sentences-100:sentences], add_special_tokens=False, return_attention_mask=False, return_token_type_ids=False) for ids in enc['input_ids']: selected_ids.update(ids) print('all english tokens nums is ',len(selected_ids)) for sentences in tqdm.tqdm(range(100,len(he_corpus),100)): enc = teacher_tokenizer(he_corpus[sentences-100:sentences], add_special_tokens=False, return_attention_mask=False, return_token_type_ids=False) for ids in enc['input_ids']: selected_ids.update(ids) print('all english+Hebrew tokens nums is ',len(selected_ids)) for tok in teacher_tokenizer.all_special_tokens: # print('special_token ',tok) selected_ids.add(teacher_tokenizer.convert_tokens_to_ids(tok)) print('all english+Hebrew_special tokens nums is ',len(selected_ids)) # 从原 vocab 中反查出对应 token orig_vocab = teacher_tokenizer.get_vocab() new_tokens = [] for tok, idx in sorted(orig_vocab.items(), key=lambda kv: kv[1]): if idx in selected_ids: new_tokens.append(tok) # 写出新的 vocab.json(Hugging Face 格式) new_vocab = {tok: i for i, tok in enumerate(new_tokens)} #修改原有tokenizer和tokenizer_config teacher_tokenizer_path='/workspace/nllb-200-distilled-600M/tokenizer.json' teacher_tokenizer_config_path='/workspace/nllb-200-distilled-600M/tokenizer_config.json' student_tokenizer_path='/workspace/distilled_model_test/tokenizer.json' student_tokenizer_config_path='/workspace/distilled_model_test/tokenizer_config.json' def _read_json(path): with open(path, "r", encoding="utf-8") as f: data = json.load(f) return data def _write_json(path,data): with open(path, "w", encoding="utf-8") as f: json.dump(data, f, ensure_ascii=False, indent=2) #change tokenizer student_tokenizer_data=_read_json(teacher_tokenizer_path) student_tokenizer_data['model']['vocab']=new_vocab for single_added_token in student_tokenizer_data['added_tokens']: single_added_token['id']=new_vocab[single_added_token['content']] new_merges=[] #change merges for merge_pair in student_tokenizer_data['model']['merges']: _temp_merge=merge_pair[0]+merge_pair[1] if _temp_merge in new_vocab.keys(): new_merges.append(merge_pair) student_tokenizer_data['model']['merges']=new_merges _write_json(student_tokenizer_path,student_tokenizer_data) #change tokenizer_config`
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37390/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37390/timeline
null
null
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
false
https://api.github.com/repos/huggingface/transformers/issues/37389
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37389/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37389/comments
https://api.github.com/repos/huggingface/transformers/issues/37389/events
https://github.com/huggingface/transformers/pull/37389
2,982,303,136
PR_kwDOCUB6oc6R67XU
37,389
[Cache] rename `max_batch_size` -> `batch_size` in compilable caches
{ "login": "gante", "id": 12240844, "node_id": "MDQ6VXNlcjEyMjQwODQ0", "avatar_url": "https://avatars.githubusercontent.com/u/12240844?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gante", "html_url": "https://github.com/gante", "followers_url": "https://api.github.com/users/gante/followers", "following_url": "https://api.github.com/users/gante/following{/other_user}", "gists_url": "https://api.github.com/users/gante/gists{/gist_id}", "starred_url": "https://api.github.com/users/gante/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gante/subscriptions", "organizations_url": "https://api.github.com/users/gante/orgs", "repos_url": "https://api.github.com/users/gante/repos", "events_url": "https://api.github.com/users/gante/events{/privacy}", "received_events_url": "https://api.github.com/users/gante/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T10:04:31
2025-04-09T11:16:22
2025-04-09T11:16:22
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37389", "html_url": "https://github.com/huggingface/transformers/pull/37389", "diff_url": "https://github.com/huggingface/transformers/pull/37389.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37389.patch", "merged_at": null }
# What does this PR do? WIP, see [this comment](https://github.com/huggingface/transformers/pull/37389#issuecomment-2789228023) ___________________________________ Uses `deprecate_kwarg` to rename `max_batch_size` to `batch_size` in all compilable caches. `max_batch_size` is a bad arg name: it implies that batch sizes smaller than `max_batch_size` can use the cache too, which is not the case. _________________________ Note that this deprecation was started before, but we messed it up along the way: 1. Deprecation process started: https://github.com/huggingface/transformers/pull/32657 2. Deprecation message got changed to the opposite of the goal: https://github.com/huggingface/transformers/pull/34921 3. User-contributed PR that respected the (modified) deprecation message: https://github.com/huggingface/transformers/pull/37007
{ "login": "gante", "id": 12240844, "node_id": "MDQ6VXNlcjEyMjQwODQ0", "avatar_url": "https://avatars.githubusercontent.com/u/12240844?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gante", "html_url": "https://github.com/gante", "followers_url": "https://api.github.com/users/gante/followers", "following_url": "https://api.github.com/users/gante/following{/other_user}", "gists_url": "https://api.github.com/users/gante/gists{/gist_id}", "starred_url": "https://api.github.com/users/gante/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gante/subscriptions", "organizations_url": "https://api.github.com/users/gante/orgs", "repos_url": "https://api.github.com/users/gante/repos", "events_url": "https://api.github.com/users/gante/events{/privacy}", "received_events_url": "https://api.github.com/users/gante/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37389/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37389/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37388
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37388/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37388/comments
https://api.github.com/repos/huggingface/transformers/issues/37388/events
https://github.com/huggingface/transformers/pull/37388
2,982,300,114
PR_kwDOCUB6oc6R66sy
37,388
Add glm4
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 1843244711, "node_id": "MDU6TGFiZWwxODQzMjQ0NzEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/New%20model", "name": "New model", "color": "fbca04", "default": false, "description": "" } ]
closed
false
null
[]
null
[]
2025-04-09T10:03:35
2025-04-09T12:02:06
2025-04-09T12:02:04
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37388", "html_url": "https://github.com/huggingface/transformers/pull/37388", "diff_url": "https://github.com/huggingface/transformers/pull/37388.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37388.patch", "merged_at": "2025-04-09T12:02:04" }
# What does this PR do?
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37388/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37388/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37387
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37387/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37387/comments
https://api.github.com/repos/huggingface/transformers/issues/37387/events
https://github.com/huggingface/transformers/pull/37387
2,982,181,752
PR_kwDOCUB6oc6R6gHg
37,387
Add Fast Image Processor for EfficientFormer
{ "login": "grewalsk", "id": 136873529, "node_id": "U_kgDOCCiGOQ", "avatar_url": "https://avatars.githubusercontent.com/u/136873529?v=4", "gravatar_id": "", "url": "https://api.github.com/users/grewalsk", "html_url": "https://github.com/grewalsk", "followers_url": "https://api.github.com/users/grewalsk/followers", "following_url": "https://api.github.com/users/grewalsk/following{/other_user}", "gists_url": "https://api.github.com/users/grewalsk/gists{/gist_id}", "starred_url": "https://api.github.com/users/grewalsk/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/grewalsk/subscriptions", "organizations_url": "https://api.github.com/users/grewalsk/orgs", "repos_url": "https://api.github.com/users/grewalsk/repos", "events_url": "https://api.github.com/users/grewalsk/events{/privacy}", "received_events_url": "https://api.github.com/users/grewalsk/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T09:28:38
2025-04-14T13:41:05
2025-04-14T13:41:05
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37387", "html_url": "https://github.com/huggingface/transformers/pull/37387", "diff_url": "https://github.com/huggingface/transformers/pull/37387.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37387.patch", "merged_at": null }
Add Fast Image Processor for EfficientFormer (#36978) Fixes # (issue) Part of the ongoing effort to add fast image processors to all vision models (issue #36978) Before submitting - [x] This PR improves performance for EfficientFormer image processing - [x] I read the contributor guideline, Pull Request section - [x] This was discussed as part of issue #36978 for adding fast image processors to all models - [x] I updated the documentation with proper docstrings following the documentation guidelines - [x] I wrote new tests for the fast image processor implementation Implements a GPU-accelerated image processor for EfficientFormer using PyTorch/torchvision operations instead of PIL/NumPy. This significantly improves performance, especially for batch processing. Key changes: - Added EfficientFormerImageProcessorFast class with GPU-accelerated methods - Updated __init__.py to include the fast processor - Created comprehensive test suite Note: 11 tests related to AutoImageProcessor integration and serialization compatibility are skipped and will be addressed in a future PR. Who can review? @yonigozlan
{ "login": "yonigozlan", "id": 74535834, "node_id": "MDQ6VXNlcjc0NTM1ODM0", "avatar_url": "https://avatars.githubusercontent.com/u/74535834?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yonigozlan", "html_url": "https://github.com/yonigozlan", "followers_url": "https://api.github.com/users/yonigozlan/followers", "following_url": "https://api.github.com/users/yonigozlan/following{/other_user}", "gists_url": "https://api.github.com/users/yonigozlan/gists{/gist_id}", "starred_url": "https://api.github.com/users/yonigozlan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yonigozlan/subscriptions", "organizations_url": "https://api.github.com/users/yonigozlan/orgs", "repos_url": "https://api.github.com/users/yonigozlan/repos", "events_url": "https://api.github.com/users/yonigozlan/events{/privacy}", "received_events_url": "https://api.github.com/users/yonigozlan/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37387/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37387/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37386
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37386/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37386/comments
https://api.github.com/repos/huggingface/transformers/issues/37386/events
https://github.com/huggingface/transformers/issues/37386
2,982,035,982
I_kwDOCUB6oc6xvkIO
37,386
LLama4 RuntimeError
{ "login": "yinzhangyue", "id": 40982202, "node_id": "MDQ6VXNlcjQwOTgyMjAy", "avatar_url": "https://avatars.githubusercontent.com/u/40982202?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yinzhangyue", "html_url": "https://github.com/yinzhangyue", "followers_url": "https://api.github.com/users/yinzhangyue/followers", "following_url": "https://api.github.com/users/yinzhangyue/following{/other_user}", "gists_url": "https://api.github.com/users/yinzhangyue/gists{/gist_id}", "starred_url": "https://api.github.com/users/yinzhangyue/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yinzhangyue/subscriptions", "organizations_url": "https://api.github.com/users/yinzhangyue/orgs", "repos_url": "https://api.github.com/users/yinzhangyue/repos", "events_url": "https://api.github.com/users/yinzhangyue/events{/privacy}", "received_events_url": "https://api.github.com/users/yinzhangyue/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-09T08:40:49
2025-04-11T15:19:53
2025-04-11T15:19:53
NONE
null
null
null
null
### System Info attn_weights = attn_weights + causal_mask ~~~~~~~~~~~~~^~~~~~~~~~~~~ RuntimeError: The size of tensor a (8192) must match the size of tensor b (177) at non-singleton dimension 3 ### Who can help? _No response_ ### Information - [ ] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction def generate_with_llama4(model, tokenizer, prompt, system_prompt=None, temperature=0.6): """Generate a response using Llama-4 model""" # Create the message format if system_prompt: messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": prompt}] else: messages = [{"role": "user", "content": prompt}] # Apply chat template without padding/truncation model_inputs = tokenizer.apply_chat_template( messages, return_tensors="pt", add_generation_prompt=True, return_dict=True ) prompt_token_count = len(model_inputs["input_ids"][0]) # Move inputs to the same device as the model model_inputs = {k: v.to(model.device) for k, v in model_inputs.items() if isinstance(v, torch.Tensor)} # Generate generated_ids = model.generate( **model_inputs, max_new_tokens=100, temperature=temperature, do_sample=True ) # Extract just the newly generated tokens new_tokens = generated_ids[:, prompt_token_count:] completion_token_count = new_tokens.shape[1] # Decode to text response = tokenizer.batch_decode(new_tokens, skip_special_tokens=True)[0] return response, prompt_token_count, completion_token_count ### Expected behavior Generate tokens
{ "login": "yinzhangyue", "id": 40982202, "node_id": "MDQ6VXNlcjQwOTgyMjAy", "avatar_url": "https://avatars.githubusercontent.com/u/40982202?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yinzhangyue", "html_url": "https://github.com/yinzhangyue", "followers_url": "https://api.github.com/users/yinzhangyue/followers", "following_url": "https://api.github.com/users/yinzhangyue/following{/other_user}", "gists_url": "https://api.github.com/users/yinzhangyue/gists{/gist_id}", "starred_url": "https://api.github.com/users/yinzhangyue/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yinzhangyue/subscriptions", "organizations_url": "https://api.github.com/users/yinzhangyue/orgs", "repos_url": "https://api.github.com/users/yinzhangyue/repos", "events_url": "https://api.github.com/users/yinzhangyue/events{/privacy}", "received_events_url": "https://api.github.com/users/yinzhangyue/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37386/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37386/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37385
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37385/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37385/comments
https://api.github.com/repos/huggingface/transformers/issues/37385/events
https://github.com/huggingface/transformers/pull/37385
2,981,843,390
PR_kwDOCUB6oc6R5Xrz
37,385
Fix in HybridChunkedCache
{ "login": "Kh4L", "id": 3193578, "node_id": "MDQ6VXNlcjMxOTM1Nzg=", "avatar_url": "https://avatars.githubusercontent.com/u/3193578?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Kh4L", "html_url": "https://github.com/Kh4L", "followers_url": "https://api.github.com/users/Kh4L/followers", "following_url": "https://api.github.com/users/Kh4L/following{/other_user}", "gists_url": "https://api.github.com/users/Kh4L/gists{/gist_id}", "starred_url": "https://api.github.com/users/Kh4L/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Kh4L/subscriptions", "organizations_url": "https://api.github.com/users/Kh4L/orgs", "repos_url": "https://api.github.com/users/Kh4L/repos", "events_url": "https://api.github.com/users/Kh4L/events{/privacy}", "received_events_url": "https://api.github.com/users/Kh4L/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T07:24:55
2025-04-09T20:01:25
2025-04-09T20:01:24
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37385", "html_url": "https://github.com/huggingface/transformers/pull/37385", "diff_url": "https://github.com/huggingface/transformers/pull/37385.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37385.patch", "merged_at": null }
Handles seq length smaller that the cache size in HybridChunkedCache Fixes #37380 @ArthurZucker for review
{ "login": "Kh4L", "id": 3193578, "node_id": "MDQ6VXNlcjMxOTM1Nzg=", "avatar_url": "https://avatars.githubusercontent.com/u/3193578?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Kh4L", "html_url": "https://github.com/Kh4L", "followers_url": "https://api.github.com/users/Kh4L/followers", "following_url": "https://api.github.com/users/Kh4L/following{/other_user}", "gists_url": "https://api.github.com/users/Kh4L/gists{/gist_id}", "starred_url": "https://api.github.com/users/Kh4L/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Kh4L/subscriptions", "organizations_url": "https://api.github.com/users/Kh4L/orgs", "repos_url": "https://api.github.com/users/Kh4L/repos", "events_url": "https://api.github.com/users/Kh4L/events{/privacy}", "received_events_url": "https://api.github.com/users/Kh4L/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37385/reactions", "total_count": 2, "+1": 1, "-1": 0, "laugh": 0, "hooray": 1, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37385/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37384
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37384/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37384/comments
https://api.github.com/repos/huggingface/transformers/issues/37384/events
https://github.com/huggingface/transformers/pull/37384
2,981,754,426
PR_kwDOCUB6oc6R5D15
37,384
Attention Quantization with FBGemm & TP
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-04-09T06:54:56
2025-04-09T16:45:44
2025-04-09T16:45:43
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37384", "html_url": "https://github.com/huggingface/transformers/pull/37384", "diff_url": "https://github.com/huggingface/transformers/pull/37384.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37384.patch", "merged_at": "2025-04-09T16:45:42" }
# What does this PR do? Adds support for attention quantization with FBGemm and TP
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37384/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37384/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37383
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37383/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37383/comments
https://api.github.com/repos/huggingface/transformers/issues/37383/events
https://github.com/huggingface/transformers/pull/37383
2,981,458,059
PR_kwDOCUB6oc6R4FWt
37,383
Fix some failing AWQ tests
{ "login": "DerekLiu35", "id": 91234588, "node_id": "MDQ6VXNlcjkxMjM0NTg4", "avatar_url": "https://avatars.githubusercontent.com/u/91234588?v=4", "gravatar_id": "", "url": "https://api.github.com/users/DerekLiu35", "html_url": "https://github.com/DerekLiu35", "followers_url": "https://api.github.com/users/DerekLiu35/followers", "following_url": "https://api.github.com/users/DerekLiu35/following{/other_user}", "gists_url": "https://api.github.com/users/DerekLiu35/gists{/gist_id}", "starred_url": "https://api.github.com/users/DerekLiu35/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DerekLiu35/subscriptions", "organizations_url": "https://api.github.com/users/DerekLiu35/orgs", "repos_url": "https://api.github.com/users/DerekLiu35/repos", "events_url": "https://api.github.com/users/DerekLiu35/events{/privacy}", "received_events_url": "https://api.github.com/users/DerekLiu35/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T03:51:52
2025-04-09T16:24:58
2025-04-09T16:24:58
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37383", "html_url": "https://github.com/huggingface/transformers/pull/37383", "diff_url": "https://github.com/huggingface/transformers/pull/37383.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37383.patch", "merged_at": "2025-04-09T16:24:58" }
This PR fixes some failures observed in the AWQ quantization tests (`tests/quantization/autoawq/test_awq.py`) Also, some notes: 1. `test_quantized_model_bf16` * Error: `RuntimeError: expected scalar type Half but found BFloat16` * Reason: `transformers>=4.50` preserves `bfloat16` dtype for scales when loading with `torch_dtype=torch.bfloat16`. However, AWQ implementation expects `float16` scales. * Solution: Cast the scales to `torch.float16` if the model's `torch_dtype` is `bfloat16` in AWQ quantizer. * Note: This resolves the `RuntimeError` but causes an `AssertionError` comparing output to a `bfloat16` baseline. This is expected, as the fix makes AWQ operate correctly in its supported `float16` mode, which differs from `bfloat16` output. 2. `test_quantized_model_no_k_proj_quantized` * Error: `RuntimeError: expected scalar type Int but found Half` * Reason: The `lm_head` module was being incorrectly identified for quantization and converted to `WQLinear_GEMM`. * Solution: Adjusted logic within the AWQ quantizer that determines the set of modules to be excluded from quantization. 3. `test_generation_fused` & `test_generation_fused_batched` * Error (CI - T4 GPU): `RuntimeError: FlashAttention only supports Ampere GPUs or newer.` * Reason (CI): The CI environment uses T4 GPUs (Compute Capability 7.5), which lack hardware support for FlashAttention * Error (Ampere+ GPU - A100): `ValueError: too many values to unpack (expected 2)` during the attention forward pass. * Reason (Ampere+): The `QuantAttentionFused` module provided by `AutoAWQ` returns 3 values. (PR #35235) have modified the expected return signature to 2 values, removing `present_key_value`, also cache implementation seems to have been changed. * Solution (Ampere+): Further investigation needed 4. `test_generation_llava_fused` * Error: `ValueError: Image features and image tokens do not match: tokens: 1, features 576` * Reason: It also seems related to (PR #35235), which seems to be first failing commit. * Solution: Further investigation needed
{ "login": "SunMarc", "id": 57196510, "node_id": "MDQ6VXNlcjU3MTk2NTEw", "avatar_url": "https://avatars.githubusercontent.com/u/57196510?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SunMarc", "html_url": "https://github.com/SunMarc", "followers_url": "https://api.github.com/users/SunMarc/followers", "following_url": "https://api.github.com/users/SunMarc/following{/other_user}", "gists_url": "https://api.github.com/users/SunMarc/gists{/gist_id}", "starred_url": "https://api.github.com/users/SunMarc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SunMarc/subscriptions", "organizations_url": "https://api.github.com/users/SunMarc/orgs", "repos_url": "https://api.github.com/users/SunMarc/repos", "events_url": "https://api.github.com/users/SunMarc/events{/privacy}", "received_events_url": "https://api.github.com/users/SunMarc/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37383/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37383/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37382
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37382/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37382/comments
https://api.github.com/repos/huggingface/transformers/issues/37382/events
https://github.com/huggingface/transformers/pull/37382
2,981,439,685
PR_kwDOCUB6oc6R4BZj
37,382
from_pretrained should handle xpu case
{ "login": "sywangyi", "id": 36058628, "node_id": "MDQ6VXNlcjM2MDU4NjI4", "avatar_url": "https://avatars.githubusercontent.com/u/36058628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sywangyi", "html_url": "https://github.com/sywangyi", "followers_url": "https://api.github.com/users/sywangyi/followers", "following_url": "https://api.github.com/users/sywangyi/following{/other_user}", "gists_url": "https://api.github.com/users/sywangyi/gists{/gist_id}", "starred_url": "https://api.github.com/users/sywangyi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sywangyi/subscriptions", "organizations_url": "https://api.github.com/users/sywangyi/orgs", "repos_url": "https://api.github.com/users/sywangyi/repos", "events_url": "https://api.github.com/users/sywangyi/events{/privacy}", "received_events_url": "https://api.github.com/users/sywangyi/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T03:34:05
2025-04-10T11:23:18
2025-04-10T11:23:18
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37382", "html_url": "https://github.com/huggingface/transformers/pull/37382", "diff_url": "https://github.com/huggingface/transformers/pull/37382.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37382.patch", "merged_at": "2025-04-10T11:23:18" }
@SunMarc @zach-huggingface please help review. find the issue when inference meta-llama/Llama-4-Scout-17B-16E in TGI. while TGI use FLASH_TRANSFORMERS_BACKEND for llama4.
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37382/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37382/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37381
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37381/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37381/comments
https://api.github.com/repos/huggingface/transformers/issues/37381/events
https://github.com/huggingface/transformers/pull/37381
2,981,187,823
PR_kwDOCUB6oc6R3LQ5
37,381
Fix mask handling for flex attention in llama/gemma2/mistral/qwen2
{ "login": "flukeskywalker", "id": 3215768, "node_id": "MDQ6VXNlcjMyMTU3Njg=", "avatar_url": "https://avatars.githubusercontent.com/u/3215768?v=4", "gravatar_id": "", "url": "https://api.github.com/users/flukeskywalker", "html_url": "https://github.com/flukeskywalker", "followers_url": "https://api.github.com/users/flukeskywalker/followers", "following_url": "https://api.github.com/users/flukeskywalker/following{/other_user}", "gists_url": "https://api.github.com/users/flukeskywalker/gists{/gist_id}", "starred_url": "https://api.github.com/users/flukeskywalker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/flukeskywalker/subscriptions", "organizations_url": "https://api.github.com/users/flukeskywalker/orgs", "repos_url": "https://api.github.com/users/flukeskywalker/repos", "events_url": "https://api.github.com/users/flukeskywalker/events{/privacy}", "received_events_url": "https://api.github.com/users/flukeskywalker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-09T00:09:58
2025-04-14T14:53:27
2025-04-14T14:53:27
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37381", "html_url": "https://github.com/huggingface/transformers/pull/37381", "diff_url": "https://github.com/huggingface/transformers/pull/37381.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37381.patch", "merged_at": "2025-04-14T14:53:27" }
# What does this PR do? **Issue** In gemma2 and mistral modelling code, where the `_update_causal_mask()` methods were not handling the case of the `atn_implementation` being the recently added `"flex_attention"`. **Main Fix** For Mistral and Gemma2: Added logic for converting attention mask passed as as a tensor to a BlockMask required for flex attention, or skip any conversion if a BlockMask is given directly by the user. This logic is borrowed from `LlamaModel`. This change also fixes the issue for Gemma3 and Qwen2 models due to inheritance. **Additional Changes** ~~- For Llama, Mistral, Gemma2: Slightly modified the previous behavior when flex_attention is enabled. Previously in `LlamaModel`, the behavior was unclear/prone to failure if flex_attention was enabled but the attention mask was neither a Tensor nor a BlockMask. The updated code adds an assertion to explicitly fail in this situation.~~ - Updated type hints and docs to reflect that attention mask may also be a BlockMask. Fixes #37299 ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [x] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @ArthurZucker
{ "login": "Rocketknight1", "id": 12866554, "node_id": "MDQ6VXNlcjEyODY2NTU0", "avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Rocketknight1", "html_url": "https://github.com/Rocketknight1", "followers_url": "https://api.github.com/users/Rocketknight1/followers", "following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}", "gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}", "starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions", "organizations_url": "https://api.github.com/users/Rocketknight1/orgs", "repos_url": "https://api.github.com/users/Rocketknight1/repos", "events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}", "received_events_url": "https://api.github.com/users/Rocketknight1/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37381/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37381/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37380
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37380/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37380/comments
https://api.github.com/repos/huggingface/transformers/issues/37380/events
https://github.com/huggingface/transformers/issues/37380
2,981,183,119
I_kwDOCUB6oc6xsT6P
37,380
Llama4 Scout fails to generate output for `use_cache=True`
{ "login": "srijanie03", "id": 34174706, "node_id": "MDQ6VXNlcjM0MTc0NzA2", "avatar_url": "https://avatars.githubusercontent.com/u/34174706?v=4", "gravatar_id": "", "url": "https://api.github.com/users/srijanie03", "html_url": "https://github.com/srijanie03", "followers_url": "https://api.github.com/users/srijanie03/followers", "following_url": "https://api.github.com/users/srijanie03/following{/other_user}", "gists_url": "https://api.github.com/users/srijanie03/gists{/gist_id}", "starred_url": "https://api.github.com/users/srijanie03/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/srijanie03/subscriptions", "organizations_url": "https://api.github.com/users/srijanie03/orgs", "repos_url": "https://api.github.com/users/srijanie03/repos", "events_url": "https://api.github.com/users/srijanie03/events{/privacy}", "received_events_url": "https://api.github.com/users/srijanie03/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-09T00:04:55
2025-04-09T19:52:29
2025-04-09T19:50:43
NONE
null
null
null
null
### System Info PyTorch version: 2.5.1 Is debug build: False CUDA used to build PyTorch: Could not collect ROCM used to build PyTorch: N/A OS: Ubuntu 22.04.4 LTS (aarch64) GCC version: (GCC) 13.3.0 Clang version: 14.0.0-1ubuntu1.1 CMake version: version 3.29.6 Libc version: glibc-2.35 Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (64-bit runtime) Python platform: Linux-6.5.0-1019-nvidia-64k-aarch64-with-glibc2.35 Is CUDA available: False CUDA runtime version: 11.5.119 CUDA_MODULE_LOADING set to: N/A GPU models and configuration: GPU 0: NVIDIA GH200 480GB Nvidia driver version: 550.90.07 cuDNN version: Probably one of the following: /usr/lib/aarch64-linux-gnu/libcudnn.so.9.3.0 /usr/lib/aarch64-linux-gnu/libcudnn_adv.so.9.3.0 /usr/lib/aarch64-linux-gnu/libcudnn_cnn.so.9.3.0 /usr/lib/aarch64-linux-gnu/libcudnn_engines_precompiled.so.9.3.0 /usr/lib/aarch64-linux-gnu/libcudnn_engines_runtime_compiled.so.9.3.0 /usr/lib/aarch64-linux-gnu/libcudnn_graph.so.9.3.0 /usr/lib/aarch64-linux-gnu/libcudnn_heuristic.so.9.3.0 /usr/lib/aarch64-linux-gnu/libcudnn_ops.so.9.3.0 HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True CPU: Architecture: aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 72 On-line CPU(s) list: 0-71 Vendor ID: ARM Model name: Neoverse-V2 Model: 0 Thread(s) per core: 1 Core(s) per socket: 72 Socket(s): 1 Stepping: r0p0 Frequency boost: disabled CPU max MHz: 3375.0000 CPU min MHz: 81.0000 BogoMIPS: 2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh bti L1d cache: 4.5 MiB (72 instances) L1i cache: 4.5 MiB (72 instances) L2 cache: 72 MiB (72 instances) L3 cache: 114 MiB (1 instance) NUMA node(s): 9 NUMA node0 CPU(s): 0-71 NUMA node1 CPU(s): NUMA node2 CPU(s): NUMA node3 CPU(s): NUMA node4 CPU(s): NUMA node5 CPU(s): NUMA node6 CPU(s): NUMA node7 CPU(s): NUMA node8 CPU(s): Vulnerability Gather data sampling: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1: Mitigation; __user pointer sanitization Vulnerability Spectre v2: Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Versions of relevant libraries: [pip3] mypy-extensions==1.0.0 [pip3] numpy==1.24.4 [pip3] onnx==1.17.0 [pip3] onnxruntime-training==1.20.0+cpu [pip3] onnxscript==0.2.3 [pip3] torch==2.5.1 [pip3] torchvision==0.20.1 [conda] numpy 2.2.4 pypi_0 pypi [conda] torch 2.6.0 pypi_0 pypi [conda] torchvision 0.21.0 pypi_0 pypi With the new transformers version 4.51.1, I am unable to get the model to generate the outputs. It works fine for the earlier version 4.51.0. I am using the default Llama4 example from HF. Error trace: ``` File "venv/lib/python3.10/site-packages/transformers/integrations/sdpa_attention.py", line 54, in sdpa_attention_forward attn_output = torch.nn.functional.scaled_dot_product_attention( RuntimeError: The size of tensor a (8192) must match the size of tensor b (4959) at non-singleton dimension 3 ``` This `print(model(**inputs), use_cache=False)` works correctly. However, for version 4.51.0, both options worked fine. ### Who can help? @ArthurZucker would really appreciate your input. ### Information - [x] The official example scripts - [ ] My own modified scripts ### Tasks - [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction ``` processor = AutoProcessor.from_pretrained("meta-llama/Llama-4-Scout-17B-16E") model = AutoModelForImageTextToText.from_pretrained("meta-llama/Llama-4-Scout-17B-16E",torch_dtype=torch.bfloat16) url1 = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/0052a70beed5bf71b92610a43a52df6d286cd5f3/diffusers/rabbit.jpg" url2 = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/datasets/cat_style_layout.png" messages = [ { "role": "user", "content": [ {"type": "image", "url": url1}, {"type": "image", "url": url2}, {"type": "text", "text": "Can you describe how these two images are similar, and how they differ?"}, ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ) print(model(**inputs)) ``` ### Expected behavior Output result as this: ``` Llama4CausalLMOutputWithPast(loss=None, logits=tensor([[[ 0.0104, -1.6641, -1.6562, ..., -1.6641, -1.6641, -1.6641], [-6.6562, 0.1108, 0.1113, ..., 0.1108, 0.1118, 0.1260], [-2.6094, -5.8125, -5.8125, ..., -5.8125, -5.8125, -5.8125], ..., [ 9.5000, 2.6875, 2.6875, ..., 2.6875, 2.6875, 2.6875], [-4.0938, 6.7188, 6.7188, ..., 6.7188, 6.7188, 6.7188], [ 5.6562, -2.7031, -2.7031, ..., -2.7031, -2.7031, -2.7031]]], dtype=torch.bfloat16, grad_fn=<UnsafeViewBackward0>), past_key_values=DynamicCacheObject, hidden_states=None, attentions=None, image_hidden_states=tensor([[[-1.6016e-01, 8.0078e-02, 6.9141e-01, ..., 5.4688e-01, -1.6016e-01, -1.6992e-01], ```
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37380/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37380/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37379
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37379/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37379/comments
https://api.github.com/repos/huggingface/transformers/issues/37379/events
https://github.com/huggingface/transformers/pull/37379
2,981,176,705
PR_kwDOCUB6oc6R3I7I
37,379
prevent creating a view/leaf param for low rank optimizers w FSDP
{ "login": "winglian", "id": 381258, "node_id": "MDQ6VXNlcjM4MTI1OA==", "avatar_url": "https://avatars.githubusercontent.com/u/381258?v=4", "gravatar_id": "", "url": "https://api.github.com/users/winglian", "html_url": "https://github.com/winglian", "followers_url": "https://api.github.com/users/winglian/followers", "following_url": "https://api.github.com/users/winglian/following{/other_user}", "gists_url": "https://api.github.com/users/winglian/gists{/gist_id}", "starred_url": "https://api.github.com/users/winglian/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/winglian/subscriptions", "organizations_url": "https://api.github.com/users/winglian/orgs", "repos_url": "https://api.github.com/users/winglian/repos", "events_url": "https://api.github.com/users/winglian/events{/privacy}", "received_events_url": "https://api.github.com/users/winglian/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T23:58:14
2025-04-11T12:36:29
2025-04-11T12:36:29
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37379", "html_url": "https://github.com/huggingface/transformers/pull/37379", "diff_url": "https://github.com/huggingface/transformers/pull/37379.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37379.patch", "merged_at": "2025-04-11T12:36:29" }
# What does this PR do? Currently, low rank optimizers like Apollo can't be used with FSDP with the error below which is caused by copying the param, causing a view/leaf of the parameter. This PR fixes that and allows apollo_adamw optimizer to be used with FSDP(1) ``` [rank0]: File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/transformers/trainer.py", line 1246, in create_optimizer [rank0]: self.optimizer = optimizer_cls(optimizer_grouped_parameters, **optimizer_kwargs) [rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/torch/_dynamo/eval_frame.py", line 745, in _fn [rank0]: return fn(*args, **kwargs) [rank0]: ^^^^^^^^^^^^^^^^^^^ [rank0]: File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/apollo_torch/apollo.py", line 74, in __init__ [rank0]: super().__init__(params, defaults) [rank0]: File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/torch/optim/optimizer.py", line 377, in __init__ [rank0]: self.add_param_group(cast(dict, param_group)) [rank0]: File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/torch/_compile.py", line 32, in inner [rank0]: return disable_fn(*args, **kwargs) [rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/torch/_dynamo/eval_frame.py", line 745, in _fn [rank0]: return fn(*args, **kwargs) [rank0]: ^^^^^^^^^^^^^^^^^^^ [rank0]: File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/torch/optim/optimizer.py", line 1062, in add_param_group [rank0]: param.is_leaf or param.retains_grad [rank0]: ^^^^^^^^^^^^^ [rank0]: RuntimeError: Output 0 of ViewBackward0 is a view and its base or another view of its base has been modified inplace. This view is the output of a function that returns multiple views. Such functions do not allow the output views to be modified ``` <!-- Remove if not applicable --> Fixes # (issue) ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @SunMarc @ArthurZucker Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37379/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37379/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37378
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37378/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37378/comments
https://api.github.com/repos/huggingface/transformers/issues/37378/events
https://github.com/huggingface/transformers/issues/37378
2,981,137,855
I_kwDOCUB6oc6xsI2_
37,378
Issue: Unexpected Shape of logits: When Using generate() with num_return_sequences > 1
{ "login": "athmanar", "id": 98558626, "node_id": "U_kgDOBd_iog", "avatar_url": "https://avatars.githubusercontent.com/u/98558626?v=4", "gravatar_id": "", "url": "https://api.github.com/users/athmanar", "html_url": "https://github.com/athmanar", "followers_url": "https://api.github.com/users/athmanar/followers", "following_url": "https://api.github.com/users/athmanar/following{/other_user}", "gists_url": "https://api.github.com/users/athmanar/gists{/gist_id}", "starred_url": "https://api.github.com/users/athmanar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/athmanar/subscriptions", "organizations_url": "https://api.github.com/users/athmanar/orgs", "repos_url": "https://api.github.com/users/athmanar/repos", "events_url": "https://api.github.com/users/athmanar/events{/privacy}", "received_events_url": "https://api.github.com/users/athmanar/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-08T23:22:54
2025-05-20T08:02:55
2025-05-20T08:02:55
NONE
null
null
null
null
Hello, I'm encountering an issue with the `generate()` function when using the **LLaMA 3.1 8B** model and setting `num_return_sequences > 1`. ### 🔍 What I'm trying to do: I want to generate multiple sequences (e.g., `num_return_sequences=2`) and retrieve the **logits for each sequence individually**. Specifically, I expect: - A list of size equal to `num_return_sequences` - Each element in the list to be a tensor of shape `[NUM_TOKENS_GENERATED_IN_THIS_SEQUENCE, VOCAB_SIZE]` - NUM_TOKENS_GENERATED_IN_THIS_SEQUENCE is variable [example 10 tokens in first sequence and 20 tokens in second sequence] ### 🧪 Code Here’s how I’m calling `generate`: ```python kwargs["return_dict_in_generate"] = True kwargs["output_scores"] = True kwargs["output_logits"] = True out = self.model.generate( input_tokens, attention_mask=attention_mask, max_new_tokens=self.max_new_tokens, do_sample=do_sample, num_return_sequences=num_samples, pad_token_id=self.tokenizer.eos_token_id, stop_strings=self.eos, tokenizer=self.tokenizer, **kwargs, ) logits = out.logits ``` ❗ Problem The returned logits is a tuple of length N, where each entry is a tensor of shape [num_return_sequences, vocab_size]. **This doesn’t seem correct or helpful in the case where each generated sequence can have a different number of tokens (due to sampling, early stopping, etc.). I suspect padding is applied internally, but it's unclear how to map each logit back to its corresponding sequence and token.** Instead, it would make sense for the output to be a list of tensors, where each tensor corresponds to one generated sequence and has shape: [NUM_TOKENS_GENERATED_IN_THIS_SEQUENCE, VOCAB_SIZE] ✅ Hacky Workaround (Works, But Slow) If I loop manually and generate one sequence at a time, the returned logits are correct: ``` ret = [] for jj in range(num_samples): out = self.model.generate( input_tokens, attention_mask=attention_mask, max_new_tokens=self.max_new_tokens, do_sample=do_sample, # num_return_sequences=num_samples, <-- intentionally commented pad_token_id=self.tokenizer.eos_token_id, stop_strings=self.eos, tokenizer=self.tokenizer, **kwargs, ) ret.append(out.logits) ``` This works (because the generation length varies naturally), but it is slow and inefficient, and defeats the purpose of num_return_sequences. 🙏 Request Could you please clarify: How can I correctly parse the logits from generate() when using num_return_sequences > 1? Shouldn't the API return something more structured (like a list of per-sequence logits)? Is this a known issue or is there a better way? cc: @zucchini-nlp @gante ### Who can help? _No response_ ### Information - [x] The official example scripts - [ ] My own modified scripts ### Tasks - [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction kwargs["return_dict_in_generate"] = True kwargs["output_scores"] = True kwargs["output_logits"] = True out = self.model.generate( input_tokens, attention_mask=attention_mask, max_new_tokens=self.max_new_tokens, do_sample=do_sample, num_return_sequences=num_samples, pad_token_id=self.tokenizer.eos_token_id, stop_strings=self.eos, tokenizer=self.tokenizer, **kwargs, ) ### Expected behavior not a padded logits of same shape.
{ "login": "github-actions[bot]", "id": 41898282, "node_id": "MDM6Qm90NDE4OTgyODI=", "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", "gravatar_id": "", "url": "https://api.github.com/users/github-actions%5Bbot%5D", "html_url": "https://github.com/apps/github-actions", "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37378/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37378/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37377
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37377/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37377/comments
https://api.github.com/repos/huggingface/transformers/issues/37377/events
https://github.com/huggingface/transformers/pull/37377
2,980,958,431
PR_kwDOCUB6oc6R2Z9T
37,377
Update fastspeech2 model card
{ "login": "ricalanis", "id": 3820751, "node_id": "MDQ6VXNlcjM4MjA3NTE=", "avatar_url": "https://avatars.githubusercontent.com/u/3820751?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ricalanis", "html_url": "https://github.com/ricalanis", "followers_url": "https://api.github.com/users/ricalanis/followers", "following_url": "https://api.github.com/users/ricalanis/following{/other_user}", "gists_url": "https://api.github.com/users/ricalanis/gists{/gist_id}", "starred_url": "https://api.github.com/users/ricalanis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ricalanis/subscriptions", "organizations_url": "https://api.github.com/users/ricalanis/orgs", "repos_url": "https://api.github.com/users/ricalanis/repos", "events_url": "https://api.github.com/users/ricalanis/events{/privacy}", "received_events_url": "https://api.github.com/users/ricalanis/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-04-08T21:14:22
2025-05-01T21:16:19
null
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37377", "html_url": "https://github.com/huggingface/transformers/pull/37377", "diff_url": "https://github.com/huggingface/transformers/pull/37377.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37377.patch", "merged_at": null }
#36979 * Updated the FastSpeech2Conformer model card * Could not replicate the pipeline example from original code, as a bug related to FastSpeech2ConformerConfig appears (AttributeError: 'FastSpeech2ConformerConfig' object has no attribute 'model_config') still left it as is. * Did not add terminal call out as I could not find a direct way to do that. * Added a small section to use the combined model with the vocoder. * Did not add quantization as the model architecture is not linear layer heavy (limited impact of quantization, AFAIK) * This was a little bit more challenging, still. really thank you for your patience! ## Before submitting - [X] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [X] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [X] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [X] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [] Did you write any new necessary tests? NA
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37377/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37377/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/37376
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37376/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37376/comments
https://api.github.com/repos/huggingface/transformers/issues/37376/events
https://github.com/huggingface/transformers/pull/37376
2,980,890,437
PR_kwDOCUB6oc6R2LKJ
37,376
Add moe kernels
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3770033588, "node_id": "LA_kwDOCUB6oc7gtiW0", "url": "https://api.github.com/repos/huggingface/transformers/labels/Kernel%20Fusion", "name": "Kernel Fusion", "color": "A956E3", "default": false, "description": "" }, { "id": 8439734066, "node_id": "LA_kwDOCUB6oc8AAAAB9wwfMg", "url": "https://api.github.com/repos/huggingface/transformers/labels/kernels", "name": "kernels", "color": "4C3716", "default": false, "description": "" } ]
closed
false
null
[]
null
[]
2025-04-08T20:38:24
2025-04-11T09:56:25
2025-04-11T09:56:23
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37376", "html_url": "https://github.com/huggingface/transformers/pull/37376", "diff_url": "https://github.com/huggingface/transformers/pull/37376.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37376.patch", "merged_at": "2025-04-11T09:56:23" }
# What does this PR do? Add MoE kernels
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37376/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37376/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37375
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37375/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37375/comments
https://api.github.com/repos/huggingface/transformers/issues/37375/events
https://github.com/huggingface/transformers/issues/37375
2,980,635,503
I_kwDOCUB6oc6xqONv
37,375
Can't load Llama4 Processor
{ "login": "pb-sameerreddy", "id": 202701550, "node_id": "U_kgDODBT67g", "avatar_url": "https://avatars.githubusercontent.com/u/202701550?v=4", "gravatar_id": "", "url": "https://api.github.com/users/pb-sameerreddy", "html_url": "https://github.com/pb-sameerreddy", "followers_url": "https://api.github.com/users/pb-sameerreddy/followers", "following_url": "https://api.github.com/users/pb-sameerreddy/following{/other_user}", "gists_url": "https://api.github.com/users/pb-sameerreddy/gists{/gist_id}", "starred_url": "https://api.github.com/users/pb-sameerreddy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pb-sameerreddy/subscriptions", "organizations_url": "https://api.github.com/users/pb-sameerreddy/orgs", "repos_url": "https://api.github.com/users/pb-sameerreddy/repos", "events_url": "https://api.github.com/users/pb-sameerreddy/events{/privacy}", "received_events_url": "https://api.github.com/users/pb-sameerreddy/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null }, { "id": 5769473378, "node_id": "LA_kwDOCUB6oc8AAAABV-MtYg", "url": "https://api.github.com/repos/huggingface/transformers/labels/Vision", "name": "Vision", "color": "C079EF", "default": false, "description": "" }, { "id": 7570656740, "node_id": "LA_kwDOCUB6oc8AAAABwz8N5A", "url": "https://api.github.com/repos/huggingface/transformers/labels/Processing", "name": "Processing", "color": "1E17DF", "default": false, "description": "" } ]
closed
false
null
[]
null
[]
2025-04-08T18:27:09
2025-05-18T08:02:21
2025-05-18T08:02:21
NONE
null
null
null
null
### System Info Error: ``` ValueError: Unrecognized image processor in meta-llama/Llama-4-Maverick-17B-128E-Instruct. Should have a `image_processor_type` key in its preprocessor_config.json of config.json, or one of the following `model_type` keys in its config.json: align, aria, beit, bit, blip, blip-2, bridgetower, chameleon, chinese_clip, clip, clipseg, conditional_detr, convnext, convnextv2, cvt, data2vec-vision, deformable_detr, deit, depth_anything, depth_pro, deta, detr, dinat, dinov2, donut-swin, dpt, efficientformer, efficientnet, flava, focalnet, fuyu, gemma3, git, glpn, got_ocr2, grounding-dino, groupvit, hiera, idefics, idefics2, idefics3, ijepa, imagegpt, instructblip, instructblipvideo, kosmos-2, layoutlmv2, layoutlmv3, levit, llama4, llava, llava_next, llava_next_video, llava_onevision, mask2former, maskformer, mgp-str, mistral3, mllama, mobilenet_v1, mobilenet_v2, mobilevit, mobilevitv2, nat, nougat, oneformer, owlv2, owlvit, paligemma, perceiver, phi4_multimodal, pix2struct, pixtral, poolformer, prompt_depth_anything, pvt, pvt_v2, qwen2_5_vl, qwen2_vl, regnet, resnet, rt_detr, sam, segformer, seggpt, shieldgemma2, siglip, siglip2, superglue, swiftformer, swin, swin2sr, swinv2, table-transformer, timesformer, timm_wrapper, tvlt, tvp, udop, upernet, van, videomae, vilt, vipllava, vit, vit_hybrid, vit_mae, vit_msn, vitmatte, xclip, yolos, zoedepth ``` Env: - `transformers` version: 4.51.1 - Platform: Linux-6.8.0-53-generic-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.30.2 - Safetensors version: 0.5.3 - Accelerate version: 0.34.2 - Accelerate config: not found - DeepSpeed version: 0.16.3 - PyTorch version (GPU?): 2.6.0+cu124 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using distributed or parallel set-up in script?: No - Using GPU in script?: Yes - GPU type: NVIDIA H200 ### Who can help? _No response_ ### Information - [ ] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction Code: ``` model_id = "meta-llama/Llama-4-Maverick-17B-128E-Instruct" processor = AutoProcessor.from_pretrained(model_id) ``` ### Expected behavior Processor loads and can be used to tokenize messages.
{ "login": "github-actions[bot]", "id": 41898282, "node_id": "MDM6Qm90NDE4OTgyODI=", "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", "gravatar_id": "", "url": "https://api.github.com/users/github-actions%5Bbot%5D", "html_url": "https://github.com/apps/github-actions", "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37375/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37375/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37374
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37374/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37374/comments
https://api.github.com/repos/huggingface/transformers/issues/37374/events
https://github.com/huggingface/transformers/pull/37374
2,980,408,635
PR_kwDOCUB6oc6R0if8
37,374
Fix typo in Gemma3ForCausalLM doctest
{ "login": "shashist", "id": 25804046, "node_id": "MDQ6VXNlcjI1ODA0MDQ2", "avatar_url": "https://avatars.githubusercontent.com/u/25804046?v=4", "gravatar_id": "", "url": "https://api.github.com/users/shashist", "html_url": "https://github.com/shashist", "followers_url": "https://api.github.com/users/shashist/followers", "following_url": "https://api.github.com/users/shashist/following{/other_user}", "gists_url": "https://api.github.com/users/shashist/gists{/gist_id}", "starred_url": "https://api.github.com/users/shashist/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/shashist/subscriptions", "organizations_url": "https://api.github.com/users/shashist/orgs", "repos_url": "https://api.github.com/users/shashist/repos", "events_url": "https://api.github.com/users/shashist/events{/privacy}", "received_events_url": "https://api.github.com/users/shashist/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-04-08T16:58:11
2025-07-07T12:08:37
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37374", "html_url": "https://github.com/huggingface/transformers/pull/37374", "diff_url": "https://github.com/huggingface/transformers/pull/37374.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37374.patch", "merged_at": null }
# What does this PR do? Update model_id used in `Gemma3ForCausalLM` doctest from `gemma-2-9b` to `gemma-3-4b-pt`. ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. @stevhliu @ArthurZucker
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37374/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37374/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/37373
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37373/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37373/comments
https://api.github.com/repos/huggingface/transformers/issues/37373/events
https://github.com/huggingface/transformers/pull/37373
2,980,322,194
PR_kwDOCUB6oc6R0PgN
37,373
Bridgetower fast image processor
{ "login": "rootonchair", "id": 23548268, "node_id": "MDQ6VXNlcjIzNTQ4MjY4", "avatar_url": "https://avatars.githubusercontent.com/u/23548268?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rootonchair", "html_url": "https://github.com/rootonchair", "followers_url": "https://api.github.com/users/rootonchair/followers", "following_url": "https://api.github.com/users/rootonchair/following{/other_user}", "gists_url": "https://api.github.com/users/rootonchair/gists{/gist_id}", "starred_url": "https://api.github.com/users/rootonchair/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rootonchair/subscriptions", "organizations_url": "https://api.github.com/users/rootonchair/orgs", "repos_url": "https://api.github.com/users/rootonchair/repos", "events_url": "https://api.github.com/users/rootonchair/events{/privacy}", "received_events_url": "https://api.github.com/users/rootonchair/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T16:26:53
2025-04-16T20:44:02
2025-04-16T20:39:18
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37373", "html_url": "https://github.com/huggingface/transformers/pull/37373", "diff_url": "https://github.com/huggingface/transformers/pull/37373.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37373.patch", "merged_at": "2025-04-16T20:39:18" }
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> Related #36978 ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "yonigozlan", "id": 74535834, "node_id": "MDQ6VXNlcjc0NTM1ODM0", "avatar_url": "https://avatars.githubusercontent.com/u/74535834?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yonigozlan", "html_url": "https://github.com/yonigozlan", "followers_url": "https://api.github.com/users/yonigozlan/followers", "following_url": "https://api.github.com/users/yonigozlan/following{/other_user}", "gists_url": "https://api.github.com/users/yonigozlan/gists{/gist_id}", "starred_url": "https://api.github.com/users/yonigozlan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yonigozlan/subscriptions", "organizations_url": "https://api.github.com/users/yonigozlan/orgs", "repos_url": "https://api.github.com/users/yonigozlan/repos", "events_url": "https://api.github.com/users/yonigozlan/events{/privacy}", "received_events_url": "https://api.github.com/users/yonigozlan/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37373/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37373/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37372
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37372/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37372/comments
https://api.github.com/repos/huggingface/transformers/issues/37372/events
https://github.com/huggingface/transformers/pull/37372
2,980,276,482
PR_kwDOCUB6oc6R0FZo
37,372
Apply torchfix to replace deprecated functions: `_pytree._register_pytree_node` and `torch.cpu.amp.autocast`
{ "login": "bzhong-solink", "id": 194111419, "node_id": "U_kgDOC5Hnuw", "avatar_url": "https://avatars.githubusercontent.com/u/194111419?v=4", "gravatar_id": "", "url": "https://api.github.com/users/bzhong-solink", "html_url": "https://github.com/bzhong-solink", "followers_url": "https://api.github.com/users/bzhong-solink/followers", "following_url": "https://api.github.com/users/bzhong-solink/following{/other_user}", "gists_url": "https://api.github.com/users/bzhong-solink/gists{/gist_id}", "starred_url": "https://api.github.com/users/bzhong-solink/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bzhong-solink/subscriptions", "organizations_url": "https://api.github.com/users/bzhong-solink/orgs", "repos_url": "https://api.github.com/users/bzhong-solink/repos", "events_url": "https://api.github.com/users/bzhong-solink/events{/privacy}", "received_events_url": "https://api.github.com/users/bzhong-solink/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T16:07:52
2025-04-10T16:23:05
2025-04-09T15:11:18
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37372", "html_url": "https://github.com/huggingface/transformers/pull/37372", "diff_url": "https://github.com/huggingface/transformers/pull/37372.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37372.patch", "merged_at": "2025-04-09T15:11:18" }
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section?
{ "login": "Rocketknight1", "id": 12866554, "node_id": "MDQ6VXNlcjEyODY2NTU0", "avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Rocketknight1", "html_url": "https://github.com/Rocketknight1", "followers_url": "https://api.github.com/users/Rocketknight1/followers", "following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}", "gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}", "starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions", "organizations_url": "https://api.github.com/users/Rocketknight1/orgs", "repos_url": "https://api.github.com/users/Rocketknight1/repos", "events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}", "received_events_url": "https://api.github.com/users/Rocketknight1/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37372/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37372/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37371
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37371/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37371/comments
https://api.github.com/repos/huggingface/transformers/issues/37371/events
https://github.com/huggingface/transformers/pull/37371
2,980,248,799
PR_kwDOCUB6oc6Rz_Qy
37,371
update deepspeed docker
{ "login": "SunMarc", "id": 57196510, "node_id": "MDQ6VXNlcjU3MTk2NTEw", "avatar_url": "https://avatars.githubusercontent.com/u/57196510?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SunMarc", "html_url": "https://github.com/SunMarc", "followers_url": "https://api.github.com/users/SunMarc/followers", "following_url": "https://api.github.com/users/SunMarc/following{/other_user}", "gists_url": "https://api.github.com/users/SunMarc/gists{/gist_id}", "starred_url": "https://api.github.com/users/SunMarc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SunMarc/subscriptions", "organizations_url": "https://api.github.com/users/SunMarc/orgs", "repos_url": "https://api.github.com/users/SunMarc/repos", "events_url": "https://api.github.com/users/SunMarc/events{/privacy}", "received_events_url": "https://api.github.com/users/SunMarc/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T15:57:46
2025-04-09T12:54:08
2025-04-09T12:54:06
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37371", "html_url": "https://github.com/huggingface/transformers/pull/37371", "diff_url": "https://github.com/huggingface/transformers/pull/37371.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37371.patch", "merged_at": "2025-04-09T12:54:06" }
# What does this PR do? This PR updates deepspeed docker so that we run our tests with pytorch 2.6
{ "login": "SunMarc", "id": 57196510, "node_id": "MDQ6VXNlcjU3MTk2NTEw", "avatar_url": "https://avatars.githubusercontent.com/u/57196510?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SunMarc", "html_url": "https://github.com/SunMarc", "followers_url": "https://api.github.com/users/SunMarc/followers", "following_url": "https://api.github.com/users/SunMarc/following{/other_user}", "gists_url": "https://api.github.com/users/SunMarc/gists{/gist_id}", "starred_url": "https://api.github.com/users/SunMarc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SunMarc/subscriptions", "organizations_url": "https://api.github.com/users/SunMarc/orgs", "repos_url": "https://api.github.com/users/SunMarc/repos", "events_url": "https://api.github.com/users/SunMarc/events{/privacy}", "received_events_url": "https://api.github.com/users/SunMarc/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37371/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37371/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37370
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37370/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37370/comments
https://api.github.com/repos/huggingface/transformers/issues/37370/events
https://github.com/huggingface/transformers/pull/37370
2,980,155,261
PR_kwDOCUB6oc6RzqkM
37,370
the fix that did not get in
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-04-08T15:26:05
2025-04-09T18:15:34
2025-04-09T18:15:33
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37370", "html_url": "https://github.com/huggingface/transformers/pull/37370", "diff_url": "https://github.com/huggingface/transformers/pull/37370.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37370.patch", "merged_at": "2025-04-09T18:15:33" }
# What does this PR do? One fix did not get in the patch, I hate the github merging interface
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37370/reactions", "total_count": 12, "+1": 0, "-1": 0, "laugh": 11, "hooray": 0, "confused": 0, "heart": 1, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37370/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37369
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37369/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37369/comments
https://api.github.com/repos/huggingface/transformers/issues/37369/events
https://github.com/huggingface/transformers/pull/37369
2,980,061,094
PR_kwDOCUB6oc6RzWTL
37,369
[Feat] Support npu in modeling models
{ "login": "duanjunwen", "id": 54985467, "node_id": "MDQ6VXNlcjU0OTg1NDY3", "avatar_url": "https://avatars.githubusercontent.com/u/54985467?v=4", "gravatar_id": "", "url": "https://api.github.com/users/duanjunwen", "html_url": "https://github.com/duanjunwen", "followers_url": "https://api.github.com/users/duanjunwen/followers", "following_url": "https://api.github.com/users/duanjunwen/following{/other_user}", "gists_url": "https://api.github.com/users/duanjunwen/gists{/gist_id}", "starred_url": "https://api.github.com/users/duanjunwen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/duanjunwen/subscriptions", "organizations_url": "https://api.github.com/users/duanjunwen/orgs", "repos_url": "https://api.github.com/users/duanjunwen/repos", "events_url": "https://api.github.com/users/duanjunwen/events{/privacy}", "received_events_url": "https://api.github.com/users/duanjunwen/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T14:54:08
2025-04-10T17:08:46
2025-04-10T17:00:59
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37369", "html_url": "https://github.com/huggingface/transformers/pull/37369", "diff_url": "https://github.com/huggingface/transformers/pull/37369.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37369.patch", "merged_at": "2025-04-10T17:00:59" }
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> Fixes # (issue) ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "ivarflakstad", "id": 69173633, "node_id": "MDQ6VXNlcjY5MTczNjMz", "avatar_url": "https://avatars.githubusercontent.com/u/69173633?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ivarflakstad", "html_url": "https://github.com/ivarflakstad", "followers_url": "https://api.github.com/users/ivarflakstad/followers", "following_url": "https://api.github.com/users/ivarflakstad/following{/other_user}", "gists_url": "https://api.github.com/users/ivarflakstad/gists{/gist_id}", "starred_url": "https://api.github.com/users/ivarflakstad/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ivarflakstad/subscriptions", "organizations_url": "https://api.github.com/users/ivarflakstad/orgs", "repos_url": "https://api.github.com/users/ivarflakstad/repos", "events_url": "https://api.github.com/users/ivarflakstad/events{/privacy}", "received_events_url": "https://api.github.com/users/ivarflakstad/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37369/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37369/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37368
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37368/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37368/comments
https://api.github.com/repos/huggingface/transformers/issues/37368/events
https://github.com/huggingface/transformers/pull/37368
2,980,001,769
PR_kwDOCUB6oc6RzJcu
37,368
[agents] remove agents 🧹
{ "login": "gante", "id": 12240844, "node_id": "MDQ6VXNlcjEyMjQwODQ0", "avatar_url": "https://avatars.githubusercontent.com/u/12240844?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gante", "html_url": "https://github.com/gante", "followers_url": "https://api.github.com/users/gante/followers", "following_url": "https://api.github.com/users/gante/following{/other_user}", "gists_url": "https://api.github.com/users/gante/gists{/gist_id}", "starred_url": "https://api.github.com/users/gante/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gante/subscriptions", "organizations_url": "https://api.github.com/users/gante/orgs", "repos_url": "https://api.github.com/users/gante/repos", "events_url": "https://api.github.com/users/gante/events{/privacy}", "received_events_url": "https://api.github.com/users/gante/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T14:34:14
2025-04-11T17:42:40
2025-04-11T17:42:37
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37368", "html_url": "https://github.com/huggingface/transformers/pull/37368", "diff_url": "https://github.com/huggingface/transformers/pull/37368.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37368.patch", "merged_at": "2025-04-11T17:42:37" }
# What does this PR do? `transformers.agents` was deprecated in #36415, scheduled to be removed in `v4.51`. `v4.51` was released last weekend, so this PR removes all traces of `transformers.agents`. Special note for the docs: I've kept a page for the `agents` and `tools`, which held a deprecation message. They now hold a reference to `smolagents`. 👉 if you were a user of `transformers.agents`: use [`smolagents`](https://github.com/huggingface/smolagents) instead, it is a greatly improved version of it!
{ "login": "gante", "id": 12240844, "node_id": "MDQ6VXNlcjEyMjQwODQ0", "avatar_url": "https://avatars.githubusercontent.com/u/12240844?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gante", "html_url": "https://github.com/gante", "followers_url": "https://api.github.com/users/gante/followers", "following_url": "https://api.github.com/users/gante/following{/other_user}", "gists_url": "https://api.github.com/users/gante/gists{/gist_id}", "starred_url": "https://api.github.com/users/gante/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gante/subscriptions", "organizations_url": "https://api.github.com/users/gante/orgs", "repos_url": "https://api.github.com/users/gante/repos", "events_url": "https://api.github.com/users/gante/events{/privacy}", "received_events_url": "https://api.github.com/users/gante/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37368/reactions", "total_count": 2, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 2, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37368/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37367
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37367/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37367/comments
https://api.github.com/repos/huggingface/transformers/issues/37367/events
https://github.com/huggingface/transformers/issues/37367
2,979,967,836
I_kwDOCUB6oc6xnrNc
37,367
Connection to cas-bridge-direct.xethub.hf.co timed out
{ "login": "valentas-kurauskas", "id": 11426795, "node_id": "MDQ6VXNlcjExNDI2Nzk1", "avatar_url": "https://avatars.githubusercontent.com/u/11426795?v=4", "gravatar_id": "", "url": "https://api.github.com/users/valentas-kurauskas", "html_url": "https://github.com/valentas-kurauskas", "followers_url": "https://api.github.com/users/valentas-kurauskas/followers", "following_url": "https://api.github.com/users/valentas-kurauskas/following{/other_user}", "gists_url": "https://api.github.com/users/valentas-kurauskas/gists{/gist_id}", "starred_url": "https://api.github.com/users/valentas-kurauskas/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/valentas-kurauskas/subscriptions", "organizations_url": "https://api.github.com/users/valentas-kurauskas/orgs", "repos_url": "https://api.github.com/users/valentas-kurauskas/repos", "events_url": "https://api.github.com/users/valentas-kurauskas/events{/privacy}", "received_events_url": "https://api.github.com/users/valentas-kurauskas/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T14:22:46
2025-04-17T06:08:30
2025-04-09T11:13:58
NONE
null
null
null
null
We have today (2025-04-08) started to get this error when running ```python from transformers import ViTModel model_name="google/vit-base-patch16-224" vit = ViTModel.from_pretrained(model_name) ``` from GCP DataFlow workers: ``` Connection to cas-bridge-direct.xethub.hf.co timed out. (connect timeout=10) ``` We generaly do only 20 such downloads per week, sometimes more. Would this be due to us exceeding some rate limits on HF side or due to a recent change in HF and security restrictions on GCP side?
{ "login": "Rocketknight1", "id": 12866554, "node_id": "MDQ6VXNlcjEyODY2NTU0", "avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Rocketknight1", "html_url": "https://github.com/Rocketknight1", "followers_url": "https://api.github.com/users/Rocketknight1/followers", "following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}", "gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}", "starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions", "organizations_url": "https://api.github.com/users/Rocketknight1/orgs", "repos_url": "https://api.github.com/users/Rocketknight1/repos", "events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}", "received_events_url": "https://api.github.com/users/Rocketknight1/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37367/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37367/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37366
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37366/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37366/comments
https://api.github.com/repos/huggingface/transformers/issues/37366/events
https://github.com/huggingface/transformers/pull/37366
2,979,703,846
PR_kwDOCUB6oc6RyIZk
37,366
Set vision config to None for Gemma 1B conversion
{ "login": "RyanMullins", "id": 868555, "node_id": "MDQ6VXNlcjg2ODU1NQ==", "avatar_url": "https://avatars.githubusercontent.com/u/868555?v=4", "gravatar_id": "", "url": "https://api.github.com/users/RyanMullins", "html_url": "https://github.com/RyanMullins", "followers_url": "https://api.github.com/users/RyanMullins/followers", "following_url": "https://api.github.com/users/RyanMullins/following{/other_user}", "gists_url": "https://api.github.com/users/RyanMullins/gists{/gist_id}", "starred_url": "https://api.github.com/users/RyanMullins/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/RyanMullins/subscriptions", "organizations_url": "https://api.github.com/users/RyanMullins/orgs", "repos_url": "https://api.github.com/users/RyanMullins/repos", "events_url": "https://api.github.com/users/RyanMullins/events{/privacy}", "received_events_url": "https://api.github.com/users/RyanMullins/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T12:52:07
2025-04-08T14:19:40
2025-04-08T13:22:32
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37366", "html_url": "https://github.com/huggingface/transformers/pull/37366", "diff_url": "https://github.com/huggingface/transformers/pull/37366.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37366.patch", "merged_at": "2025-04-08T13:22:32" }
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> Fixes # (issue) ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [x] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [x] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "Rocketknight1", "id": 12866554, "node_id": "MDQ6VXNlcjEyODY2NTU0", "avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Rocketknight1", "html_url": "https://github.com/Rocketknight1", "followers_url": "https://api.github.com/users/Rocketknight1/followers", "following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}", "gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}", "starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions", "organizations_url": "https://api.github.com/users/Rocketknight1/orgs", "repos_url": "https://api.github.com/users/Rocketknight1/repos", "events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}", "received_events_url": "https://api.github.com/users/Rocketknight1/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37366/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37366/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37365
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37365/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37365/comments
https://api.github.com/repos/huggingface/transformers/issues/37365/events
https://github.com/huggingface/transformers/pull/37365
2,979,518,506
PR_kwDOCUB6oc6Rxf4-
37,365
[llama 4] dynamic rope decorator
{ "login": "gante", "id": 12240844, "node_id": "MDQ6VXNlcjEyMjQwODQ0", "avatar_url": "https://avatars.githubusercontent.com/u/12240844?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gante", "html_url": "https://github.com/gante", "followers_url": "https://api.github.com/users/gante/followers", "following_url": "https://api.github.com/users/gante/following{/other_user}", "gists_url": "https://api.github.com/users/gante/gists{/gist_id}", "starred_url": "https://api.github.com/users/gante/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gante/subscriptions", "organizations_url": "https://api.github.com/users/gante/orgs", "repos_url": "https://api.github.com/users/gante/repos", "events_url": "https://api.github.com/users/gante/events{/privacy}", "received_events_url": "https://api.github.com/users/gante/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T11:39:36
2025-04-08T14:56:34
2025-04-08T14:56:31
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37365", "html_url": "https://github.com/huggingface/transformers/pull/37365", "diff_url": "https://github.com/huggingface/transformers/pull/37365.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37365.patch", "merged_at": "2025-04-08T14:56:31" }
# What does this PR do? Same as #37249, but applied to Llama 4 Also updates the docstrings of the Hybrid Caches.
{ "login": "gante", "id": 12240844, "node_id": "MDQ6VXNlcjEyMjQwODQ0", "avatar_url": "https://avatars.githubusercontent.com/u/12240844?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gante", "html_url": "https://github.com/gante", "followers_url": "https://api.github.com/users/gante/followers", "following_url": "https://api.github.com/users/gante/following{/other_user}", "gists_url": "https://api.github.com/users/gante/gists{/gist_id}", "starred_url": "https://api.github.com/users/gante/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gante/subscriptions", "organizations_url": "https://api.github.com/users/gante/orgs", "repos_url": "https://api.github.com/users/gante/repos", "events_url": "https://api.github.com/users/gante/events{/privacy}", "received_events_url": "https://api.github.com/users/gante/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37365/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37365/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37364
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37364/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37364/comments
https://api.github.com/repos/huggingface/transformers/issues/37364/events
https://github.com/huggingface/transformers/issues/37364
2,979,393,992
I_kwDOCUB6oc6xlfHI
37,364
How to find a specific func doc when using transformers doc?
{ "login": "habaohaba", "id": 34515931, "node_id": "MDQ6VXNlcjM0NTE1OTMx", "avatar_url": "https://avatars.githubusercontent.com/u/34515931?v=4", "gravatar_id": "", "url": "https://api.github.com/users/habaohaba", "html_url": "https://github.com/habaohaba", "followers_url": "https://api.github.com/users/habaohaba/followers", "following_url": "https://api.github.com/users/habaohaba/following{/other_user}", "gists_url": "https://api.github.com/users/habaohaba/gists{/gist_id}", "starred_url": "https://api.github.com/users/habaohaba/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/habaohaba/subscriptions", "organizations_url": "https://api.github.com/users/habaohaba/orgs", "repos_url": "https://api.github.com/users/habaohaba/repos", "events_url": "https://api.github.com/users/habaohaba/events{/privacy}", "received_events_url": "https://api.github.com/users/habaohaba/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 2648621985, "node_id": "MDU6TGFiZWwyNjQ4NjIxOTg1", "url": "https://api.github.com/repos/huggingface/transformers/labels/Feature%20request", "name": "Feature request", "color": "FBCA04", "default": false, "description": "Request for a new feature" } ]
open
false
null
[]
null
[]
2025-04-08T10:48:04
2025-09-15T19:16:35
null
NONE
null
null
null
null
### Feature request Better UX for doc ### Motivation The search and UI layout make it so hard to find a func doc, especially when there are so many func doc in one webpage and your just can not find what you want by web page search. ### Your contribution no, right now
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37364/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37364/timeline
null
null
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
false
https://api.github.com/repos/huggingface/transformers/issues/37363
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37363/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37363/comments
https://api.github.com/repos/huggingface/transformers/issues/37363/events
https://github.com/huggingface/transformers/pull/37363
2,979,282,151
PR_kwDOCUB6oc6Rwr4e
37,363
Fix SDPA attention precision issue in Qwen2.5-VL
{ "login": "JJJYmmm", "id": 92386084, "node_id": "U_kgDOBYGzJA", "avatar_url": "https://avatars.githubusercontent.com/u/92386084?v=4", "gravatar_id": "", "url": "https://api.github.com/users/JJJYmmm", "html_url": "https://github.com/JJJYmmm", "followers_url": "https://api.github.com/users/JJJYmmm/followers", "following_url": "https://api.github.com/users/JJJYmmm/following{/other_user}", "gists_url": "https://api.github.com/users/JJJYmmm/gists{/gist_id}", "starred_url": "https://api.github.com/users/JJJYmmm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JJJYmmm/subscriptions", "organizations_url": "https://api.github.com/users/JJJYmmm/orgs", "repos_url": "https://api.github.com/users/JJJYmmm/repos", "events_url": "https://api.github.com/users/JJJYmmm/events{/privacy}", "received_events_url": "https://api.github.com/users/JJJYmmm/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T10:07:17
2025-07-09T05:03:44
2025-07-09T05:03:44
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37363", "html_url": "https://github.com/huggingface/transformers/pull/37363", "diff_url": "https://github.com/huggingface/transformers/pull/37363.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37363.patch", "merged_at": "2025-07-09T05:03:44" }
# What does this PR do? Implemented an non-mask-based window attention mechanism for the eager/sdpa version in Qwen2.5-VL. For more details, see: [Qwen2.5-VL Issue #1049](https://github.com/QwenLM/Qwen2.5-VL/issues/1049) After the modifications, both memory usage and inference time have been improved, with inference time nearly halving (reduced by approximately 50%) for eager/sdpa. This optimization may be particularly beneficial for users working with hardware like the V100 or others that do not support Flash Attention. settings: - single A100 GPUs - image size: 1000x2530 - repeat 20 times ```bash **flash attn:** Mean Inference time: 0.22 seconds Peak GPU memory allocated: 16295.05 MB **eager:** Mean Inference time: 2.43 seconds Peak GPU memory allocated: 38783.01 MB **eager(modified):** Mean Inference time: 1.39 seconds Peak GPU memory allocated: 37503.01 MB **sdpa:** Mean Inference time: 4.30 seconds Peak GPU memory allocated: 36929.76 MB **sdpa(modified):** Mean Inference time: 1.88 seconds Peak GPU memory allocated: 36509.76 MB ``` ```python import time from PIL import Image import torch from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor def inference_visual(img_url, model, processor): image = Image.open(img_url) inputs = processor.image_processor(images=[image], return_tensors="pt").to('cuda') repeat_times = 20 torch.cuda.reset_peak_memory_stats() start_time = time.time() for _ in range(repeat_times): model.visual(inputs['pixel_values'].to(model.visual.dtype), grid_thw = inputs['image_grid_thw']) end_time = time.time() elapsed_time = end_time - start_time gpu_peak_memory = torch.cuda.max_memory_allocated() / (1024 ** 2) print(f"Mean Inference time: {(elapsed_time / repeat_times):.2f} seconds") print(f"Peak GPU memory allocated: {gpu_peak_memory:.2f} MB") if __name__ == "__main__": model_path = "path/to/qwen2_5vl" model = Qwen2_5_VLForConditionalGeneration.from_pretrained(model_path, torch_dtype=torch.bfloat16, attn_implementation="eager", # attn_implementation="sdpa", # attn_implementation="flash_attention_2", device_map="cpu").cuda() processor = AutoProcessor.from_pretrained(model_path) image_path = 'Qwen2.5-vl-Capybara.png' # https://qianwen-res.oss-accelerate-overseas.aliyuncs.com/Qwen2.5-vl-Capybara.png with torch.no_grad(): inference_visual(image_path, model, processor) ``` Models: - vision models: @amyeroberts, @qubvel
{ "login": "zucchini-nlp", "id": 100715397, "node_id": "U_kgDOBgDLhQ", "avatar_url": "https://avatars.githubusercontent.com/u/100715397?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zucchini-nlp", "html_url": "https://github.com/zucchini-nlp", "followers_url": "https://api.github.com/users/zucchini-nlp/followers", "following_url": "https://api.github.com/users/zucchini-nlp/following{/other_user}", "gists_url": "https://api.github.com/users/zucchini-nlp/gists{/gist_id}", "starred_url": "https://api.github.com/users/zucchini-nlp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zucchini-nlp/subscriptions", "organizations_url": "https://api.github.com/users/zucchini-nlp/orgs", "repos_url": "https://api.github.com/users/zucchini-nlp/repos", "events_url": "https://api.github.com/users/zucchini-nlp/events{/privacy}", "received_events_url": "https://api.github.com/users/zucchini-nlp/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37363/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37363/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37362
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37362/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37362/comments
https://api.github.com/repos/huggingface/transformers/issues/37362/events
https://github.com/huggingface/transformers/pull/37362
2,979,259,529
PR_kwDOCUB6oc6Rwm7-
37,362
[processor] clean up mulitmodal tests
{ "login": "zucchini-nlp", "id": 100715397, "node_id": "U_kgDOBgDLhQ", "avatar_url": "https://avatars.githubusercontent.com/u/100715397?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zucchini-nlp", "html_url": "https://github.com/zucchini-nlp", "followers_url": "https://api.github.com/users/zucchini-nlp/followers", "following_url": "https://api.github.com/users/zucchini-nlp/following{/other_user}", "gists_url": "https://api.github.com/users/zucchini-nlp/gists{/gist_id}", "starred_url": "https://api.github.com/users/zucchini-nlp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zucchini-nlp/subscriptions", "organizations_url": "https://api.github.com/users/zucchini-nlp/orgs", "repos_url": "https://api.github.com/users/zucchini-nlp/repos", "events_url": "https://api.github.com/users/zucchini-nlp/events{/privacy}", "received_events_url": "https://api.github.com/users/zucchini-nlp/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T09:58:58
2025-04-11T11:32:19
2025-04-11T11:32:19
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37362", "html_url": "https://github.com/huggingface/transformers/pull/37362", "diff_url": "https://github.com/huggingface/transformers/pull/37362.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37362.patch", "merged_at": "2025-04-11T11:32:19" }
# What does this PR do? As per title, remove overriden parts that handle special multimodal tokens. Also fixes Aria and Idefics image processors by adding `do_rescale` in configurable init params, thus removing overridden tests cc @ydshieh for tests and @qubvel for main processor code
{ "login": "zucchini-nlp", "id": 100715397, "node_id": "U_kgDOBgDLhQ", "avatar_url": "https://avatars.githubusercontent.com/u/100715397?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zucchini-nlp", "html_url": "https://github.com/zucchini-nlp", "followers_url": "https://api.github.com/users/zucchini-nlp/followers", "following_url": "https://api.github.com/users/zucchini-nlp/following{/other_user}", "gists_url": "https://api.github.com/users/zucchini-nlp/gists{/gist_id}", "starred_url": "https://api.github.com/users/zucchini-nlp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zucchini-nlp/subscriptions", "organizations_url": "https://api.github.com/users/zucchini-nlp/orgs", "repos_url": "https://api.github.com/users/zucchini-nlp/repos", "events_url": "https://api.github.com/users/zucchini-nlp/events{/privacy}", "received_events_url": "https://api.github.com/users/zucchini-nlp/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37362/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37362/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37361
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37361/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37361/comments
https://api.github.com/repos/huggingface/transformers/issues/37361/events
https://github.com/huggingface/transformers/issues/37361
2,979,112,740
I_kwDOCUB6oc6xkack
37,361
NameError: "init_empty_weights" not defined - ESM family models
{ "login": "Eloffredo", "id": 104976219, "node_id": "U_kgDOBkHPWw", "avatar_url": "https://avatars.githubusercontent.com/u/104976219?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Eloffredo", "html_url": "https://github.com/Eloffredo", "followers_url": "https://api.github.com/users/Eloffredo/followers", "following_url": "https://api.github.com/users/Eloffredo/following{/other_user}", "gists_url": "https://api.github.com/users/Eloffredo/gists{/gist_id}", "starred_url": "https://api.github.com/users/Eloffredo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Eloffredo/subscriptions", "organizations_url": "https://api.github.com/users/Eloffredo/orgs", "repos_url": "https://api.github.com/users/Eloffredo/repos", "events_url": "https://api.github.com/users/Eloffredo/events{/privacy}", "received_events_url": "https://api.github.com/users/Eloffredo/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-08T09:04:29
2025-04-08T16:06:29
2025-04-08T16:06:28
NONE
null
null
null
null
### System Info ### **Issue** Using the latest release ``v4.51.0`` I get a NameError when loading the ESM model with ``facebook/esm2_t33_650M_UR50D``. Using the previous ``v4.50.3`` everything is working fine. **system info** ``` - `transformers` version: 4.51.0 - Platform: Linux-6.8.0-1021-aws-x86_64-with-glibc2.35 - Python version: 3.13.1 - Huggingface_hub version: 0.30.2 - Safetensors version: 0.5.3 - Accelerate version: not installed - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (GPU?): 2.6.0+cu124 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using distributed or parallel set-up in script?: <fill in> - Using GPU in script?: <fill in> - GPU type: NVIDIA A10G ``` ### Who can help? _No response_ ### Information - [x] The official example scripts - [ ] My own modified scripts ### Tasks - [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction ### **Reproducibility** I run ``uv run python hello.py`` with these two files: **hello.py** ``` import transformers from transformers import EsmForMaskedLM def main(): print(transformers.__version__) model_name = "facebook/esm2_t33_650M_UR50D" model = EsmForMaskedLM.from_pretrained(model_name) print(model) if __name__ == "__main__": main() ``` **pyproject.toml** ``` [project] name = "temp" version = "0.1.0" description = "Add your description here" requires-python = ">=3.13" dependencies = [ "torch", "transformers==4.51.0", ] ``` ### **Full traceback** ``` File "/home/ssm-user/transformer-project/./hello.py", line 11, in <module> main() ~~~~^^ File "/home/ssm-user/transformer-project/./hello.py", line 7, in main model = EsmForMaskedLM.from_pretrained(model_name) File "/home/ssm-user/transformer-project/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 279, in _wrapper return func(*args, **kwargs) File "/home/ssm-user/transformer-project/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 4333, in from_pretrained model_init_context = cls.get_init_context(is_quantized, _is_ds_init_called) File "/home/ssm-user/transformer-project/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 3736, in get_init_context init_contexts = [no_init_weights(), init_empty_weights()] ^^^^^^^^^^^^^^^^^^ NameError: name 'init_empty_weights' is not defined ``` ### Expected behavior The expected behavior is to instantiate the pretrained model without any issue.
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37361/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37361/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37360
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37360/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37360/comments
https://api.github.com/repos/huggingface/transformers/issues/37360/events
https://github.com/huggingface/transformers/issues/37360
2,979,069,166
I_kwDOCUB6oc6xkPzu
37,360
Gemma 3 series model default loading behavior of dtype
{ "login": "HuangBugWei", "id": 67520151, "node_id": "MDQ6VXNlcjY3NTIwMTUx", "avatar_url": "https://avatars.githubusercontent.com/u/67520151?v=4", "gravatar_id": "", "url": "https://api.github.com/users/HuangBugWei", "html_url": "https://github.com/HuangBugWei", "followers_url": "https://api.github.com/users/HuangBugWei/followers", "following_url": "https://api.github.com/users/HuangBugWei/following{/other_user}", "gists_url": "https://api.github.com/users/HuangBugWei/gists{/gist_id}", "starred_url": "https://api.github.com/users/HuangBugWei/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/HuangBugWei/subscriptions", "organizations_url": "https://api.github.com/users/HuangBugWei/orgs", "repos_url": "https://api.github.com/users/HuangBugWei/repos", "events_url": "https://api.github.com/users/HuangBugWei/events{/privacy}", "received_events_url": "https://api.github.com/users/HuangBugWei/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-08T08:47:47
2025-04-08T12:51:24
2025-04-08T12:51:23
CONTRIBUTOR
null
null
null
null
### System Info - `transformers` version: 4.51.0 - Platform: Linux-5.4.17-2136.339.5.el8uek.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.13 - Huggingface_hub version: 0.30.1 - Safetensors version: 0.5.2 - Accelerate version: 1.6.0 - Accelerate config: - compute_environment: LOCAL_MACHINE - distributed_type: MULTI_GPU - mixed_precision: fp16 - use_cpu: False - debug: False - num_processes: 1 - machine_rank: 0 - num_machines: 1 - gpu_ids: all - rdzv_backend: static - same_network: True - main_training_function: main - enable_cpu_affinity: False - downcast_bf16: no - tpu_use_cluster: False - tpu_use_sudo: False - DeepSpeed version: 0.16.3 - PyTorch version (GPU?): 2.5.1+cu124 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using distributed or parallel set-up in script?: yes - Using GPU in script?: yes - GPU type: NVIDIA GeForce RTX 3090 ### Who can help? @gante @zucchini-nlp ### Information - [ ] The official example scripts - [x] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction ```python # pip install accelerate from transformers import AutoProcessor, Gemma3ForConditionalGeneration from PIL import Image import requests import torch model_id = "google/gemma-3-12b-it" model = Gemma3ForConditionalGeneration.from_pretrained( model_id, device_map="auto", # torch_dtype=torch.bfloat16 ).eval() processor = AutoProcessor.from_pretrained(model_id) print(model.dtype) # torch.float32 ``` ### Expected behavior Hello, When I attempted to load the Gemma 3 12B model, I ran into an OOM error. After investigation, I found that the model was being loaded in FP32 by default. I know explicitly setting the `torch_dtype` allows users to choose the precision that best suits their needs and provides a clearer understanding of their code's behavior. However, the official example code for Gemma 3 12B does not explicitly specify the torch_dtype argument in the from_pretrained function. And according to the official documentation, https://github.com/huggingface/transformers/blob/794fde7b1c3d041519fc28ea3e1461b0cfcad4e7/src/transformers/modeling_utils.py#L3838-L3860 Based on this documentation, it seems that if `torch_dtype` is not explicitly set, the library should first check for a `torch_dtype` entry in the model's `config.json`. And `config.json` of Gemma 3 is BF16, thus, the default loading behavior of FP32 is a bit surprising. Could you please confirm whether the current default behavior of Gemma 3 12B is intended, or if I'm misunderstanding something. Thank you for your time and attention to this matter.
{ "login": "zucchini-nlp", "id": 100715397, "node_id": "U_kgDOBgDLhQ", "avatar_url": "https://avatars.githubusercontent.com/u/100715397?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zucchini-nlp", "html_url": "https://github.com/zucchini-nlp", "followers_url": "https://api.github.com/users/zucchini-nlp/followers", "following_url": "https://api.github.com/users/zucchini-nlp/following{/other_user}", "gists_url": "https://api.github.com/users/zucchini-nlp/gists{/gist_id}", "starred_url": "https://api.github.com/users/zucchini-nlp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zucchini-nlp/subscriptions", "organizations_url": "https://api.github.com/users/zucchini-nlp/orgs", "repos_url": "https://api.github.com/users/zucchini-nlp/repos", "events_url": "https://api.github.com/users/zucchini-nlp/events{/privacy}", "received_events_url": "https://api.github.com/users/zucchini-nlp/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37360/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37360/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37359
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37359/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37359/comments
https://api.github.com/repos/huggingface/transformers/issues/37359/events
https://github.com/huggingface/transformers/pull/37359
2,978,842,327
PR_kwDOCUB6oc6RvM0T
37,359
fix: llama4 conversion script no_rope_layers
{ "login": "jmkuebler", "id": 44084297, "node_id": "MDQ6VXNlcjQ0MDg0Mjk3", "avatar_url": "https://avatars.githubusercontent.com/u/44084297?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jmkuebler", "html_url": "https://github.com/jmkuebler", "followers_url": "https://api.github.com/users/jmkuebler/followers", "following_url": "https://api.github.com/users/jmkuebler/following{/other_user}", "gists_url": "https://api.github.com/users/jmkuebler/gists{/gist_id}", "starred_url": "https://api.github.com/users/jmkuebler/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmkuebler/subscriptions", "organizations_url": "https://api.github.com/users/jmkuebler/orgs", "repos_url": "https://api.github.com/users/jmkuebler/repos", "events_url": "https://api.github.com/users/jmkuebler/events{/privacy}", "received_events_url": "https://api.github.com/users/jmkuebler/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T07:17:02
2025-04-09T11:27:38
2025-04-09T11:02:15
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37359", "html_url": "https://github.com/huggingface/transformers/pull/37359", "diff_url": "https://github.com/huggingface/transformers/pull/37359.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37359.patch", "merged_at": "2025-04-09T11:02:15" }
# What does this PR do? `no_rope_layers` should either be a list of NoPE layers or `None`, such that it is created in the config from the `no_rope_layer_interval`, see https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama4/configuration_llama4.py#L338-L343 <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> Fixes [(incompatibility issue)](https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct-Original/discussions/4) ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 --> @ArthurZucker @Vaibhavs10
{ "login": "pcuenca", "id": 1177582, "node_id": "MDQ6VXNlcjExNzc1ODI=", "avatar_url": "https://avatars.githubusercontent.com/u/1177582?v=4", "gravatar_id": "", "url": "https://api.github.com/users/pcuenca", "html_url": "https://github.com/pcuenca", "followers_url": "https://api.github.com/users/pcuenca/followers", "following_url": "https://api.github.com/users/pcuenca/following{/other_user}", "gists_url": "https://api.github.com/users/pcuenca/gists{/gist_id}", "starred_url": "https://api.github.com/users/pcuenca/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pcuenca/subscriptions", "organizations_url": "https://api.github.com/users/pcuenca/orgs", "repos_url": "https://api.github.com/users/pcuenca/repos", "events_url": "https://api.github.com/users/pcuenca/events{/privacy}", "received_events_url": "https://api.github.com/users/pcuenca/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37359/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37359/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37358
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37358/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37358/comments
https://api.github.com/repos/huggingface/transformers/issues/37358/events
https://github.com/huggingface/transformers/pull/37358
2,978,758,833
PR_kwDOCUB6oc6Ru7X0
37,358
Defaults to adamw_torch_fused for Pytorch>=2.8
{ "login": "cyyever", "id": 17618148, "node_id": "MDQ6VXNlcjE3NjE4MTQ4", "avatar_url": "https://avatars.githubusercontent.com/u/17618148?v=4", "gravatar_id": "", "url": "https://api.github.com/users/cyyever", "html_url": "https://github.com/cyyever", "followers_url": "https://api.github.com/users/cyyever/followers", "following_url": "https://api.github.com/users/cyyever/following{/other_user}", "gists_url": "https://api.github.com/users/cyyever/gists{/gist_id}", "starred_url": "https://api.github.com/users/cyyever/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cyyever/subscriptions", "organizations_url": "https://api.github.com/users/cyyever/orgs", "repos_url": "https://api.github.com/users/cyyever/repos", "events_url": "https://api.github.com/users/cyyever/events{/privacy}", "received_events_url": "https://api.github.com/users/cyyever/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-08T06:39:30
2025-07-16T14:13:45
2025-07-16T09:52:33
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37358", "html_url": "https://github.com/huggingface/transformers/pull/37358", "diff_url": "https://github.com/huggingface/transformers/pull/37358.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37358.patch", "merged_at": "2025-07-16T09:52:33" }
# What does this PR do? According to the comment, transformers should default to adamw_torch_fused after PT 2.1. However, the condition is lift to PT 2.8 to ensure that adamw_torch_fused is mature enough.
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37358/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37358/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37357
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37357/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37357/comments
https://api.github.com/repos/huggingface/transformers/issues/37357/events
https://github.com/huggingface/transformers/pull/37357
2,978,257,969
PR_kwDOCUB6oc6RtSZ1
37,357
support overlapping masks in mask2former image processor
{ "login": "SeKim12", "id": 63029244, "node_id": "MDQ6VXNlcjYzMDI5MjQ0", "avatar_url": "https://avatars.githubusercontent.com/u/63029244?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SeKim12", "html_url": "https://github.com/SeKim12", "followers_url": "https://api.github.com/users/SeKim12/followers", "following_url": "https://api.github.com/users/SeKim12/following{/other_user}", "gists_url": "https://api.github.com/users/SeKim12/gists{/gist_id}", "starred_url": "https://api.github.com/users/SeKim12/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SeKim12/subscriptions", "organizations_url": "https://api.github.com/users/SeKim12/orgs", "repos_url": "https://api.github.com/users/SeKim12/repos", "events_url": "https://api.github.com/users/SeKim12/events{/privacy}", "received_events_url": "https://api.github.com/users/SeKim12/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-04-08T00:06:26
2025-06-03T00:19:52
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37357", "html_url": "https://github.com/huggingface/transformers/pull/37357", "diff_url": "https://github.com/huggingface/transformers/pull/37357.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37357.patch", "merged_at": null }
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> This PR allows for the Mask2Former Image Processor to handle overlapping masks (which the model can already handle), with some user constraints such as having to explicitly provide the `input_data_format`. Fixes # (issue) #35536 As well as use-cases outlined [here1](https://stackoverflow.com/questions/79331752/does-the-huggingface-mask2formerimageprocessor-support-overlapping-features) and [here2](https://github.com/NielsRogge/Transformers-Tutorials/issues/296#issuecomment-1657815329). ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @qubvel <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37357/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37357/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/37356
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37356/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37356/comments
https://api.github.com/repos/huggingface/transformers/issues/37356/events
https://github.com/huggingface/transformers/pull/37356
2,978,201,095
PR_kwDOCUB6oc6RtGpe
37,356
Fix typing issues with SigLip2
{ "login": "EricWiener", "id": 18071029, "node_id": "MDQ6VXNlcjE4MDcxMDI5", "avatar_url": "https://avatars.githubusercontent.com/u/18071029?v=4", "gravatar_id": "", "url": "https://api.github.com/users/EricWiener", "html_url": "https://github.com/EricWiener", "followers_url": "https://api.github.com/users/EricWiener/followers", "following_url": "https://api.github.com/users/EricWiener/following{/other_user}", "gists_url": "https://api.github.com/users/EricWiener/gists{/gist_id}", "starred_url": "https://api.github.com/users/EricWiener/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/EricWiener/subscriptions", "organizations_url": "https://api.github.com/users/EricWiener/orgs", "repos_url": "https://api.github.com/users/EricWiener/repos", "events_url": "https://api.github.com/users/EricWiener/events{/privacy}", "received_events_url": "https://api.github.com/users/EricWiener/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T23:20:36
2025-04-11T21:24:41
2025-04-11T21:24:24
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37356", "html_url": "https://github.com/huggingface/transformers/pull/37356", "diff_url": "https://github.com/huggingface/transformers/pull/37356.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37356.patch", "merged_at": "2025-04-11T21:24:24" }
# What does this PR do? Fixes #36754 ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "qubvel", "id": 31920396, "node_id": "MDQ6VXNlcjMxOTIwMzk2", "avatar_url": "https://avatars.githubusercontent.com/u/31920396?v=4", "gravatar_id": "", "url": "https://api.github.com/users/qubvel", "html_url": "https://github.com/qubvel", "followers_url": "https://api.github.com/users/qubvel/followers", "following_url": "https://api.github.com/users/qubvel/following{/other_user}", "gists_url": "https://api.github.com/users/qubvel/gists{/gist_id}", "starred_url": "https://api.github.com/users/qubvel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/qubvel/subscriptions", "organizations_url": "https://api.github.com/users/qubvel/orgs", "repos_url": "https://api.github.com/users/qubvel/repos", "events_url": "https://api.github.com/users/qubvel/events{/privacy}", "received_events_url": "https://api.github.com/users/qubvel/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37356/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37356/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37355
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37355/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37355/comments
https://api.github.com/repos/huggingface/transformers/issues/37355/events
https://github.com/huggingface/transformers/issues/37355
2,978,035,475
I_kwDOCUB6oc6xgTcT
37,355
[llama4] Inference with multiple GPU torch.distributed.DistStoreError
{ "login": "GilgameshD", "id": 13979878, "node_id": "MDQ6VXNlcjEzOTc5ODc4", "avatar_url": "https://avatars.githubusercontent.com/u/13979878?v=4", "gravatar_id": "", "url": "https://api.github.com/users/GilgameshD", "html_url": "https://github.com/GilgameshD", "followers_url": "https://api.github.com/users/GilgameshD/followers", "following_url": "https://api.github.com/users/GilgameshD/following{/other_user}", "gists_url": "https://api.github.com/users/GilgameshD/gists{/gist_id}", "starred_url": "https://api.github.com/users/GilgameshD/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/GilgameshD/subscriptions", "organizations_url": "https://api.github.com/users/GilgameshD/orgs", "repos_url": "https://api.github.com/users/GilgameshD/repos", "events_url": "https://api.github.com/users/GilgameshD/events{/privacy}", "received_events_url": "https://api.github.com/users/GilgameshD/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-07T21:27:45
2025-04-11T11:59:16
2025-04-07T22:49:04
NONE
null
null
null
null
### System Info - `transformers` version: 4.52.0.dev0 - Platform: Linux-5.15.0-1032-oracle-x86_64-with-glibc2.31 - Python version: 3.10.16 - Huggingface_hub version: 0.30.1 - Safetensors version: 0.5.2 - Accelerate version: 1.3.0 - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (GPU?): 2.6.0+cu124 (False) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using distributed or parallel set-up in script?: Yes - Using GPU in script?: Yes - GPU type: NVIDIA A100-SXM4-80GB x 8 ### Who can help? @ArthurZucker ### Information - [x] The official example scripts - [ ] My own modified scripts ### Tasks - [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction I am using the official example of llama4 with the latest transformer code: ``` from transformers import AutoProcessor, Llama4ForConditionalGeneration import torch model_id = "meta-llama/Llama-4-Scout-17B-16E-Instruct" processor = AutoProcessor.from_pretrained(model_id) model = Llama4ForConditionalGeneration.from_pretrained( model_id, attn_implementation="flex_attention", device_map="auto", torch_dtype=torch.bfloat16, ) url1 = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/0052a70beed5bf71b92610a43a52df6d286cd5f3/diffusers/rabbit.jpg" url2 = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/datasets/cat_style_layout.png" messages = [ { "role": "user", "content": [ {"type": "image", "url": url1}, {"type": "image", "url": url2}, { "type": "text", "text": "Can you describe how these two images are similar, and how they differ?", }, ], }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate( **inputs, max_new_tokens=256, ) response = processor.batch_decode(outputs[:, inputs["input_ids"].shape[-1] :])[0] print(response) print(outputs[0]) ``` I got the following error: ``` torch.distributed.DistStoreError: Timed out after 601 seconds waiting for clients. 1/8 clients joined. OSError: We tried to initialize torch.distributed for you, but it failed, makesure you init torch distributed in your script to use `tp_plan='auto'` ``` ### Expected behavior Text output from the model
{ "login": "GilgameshD", "id": 13979878, "node_id": "MDQ6VXNlcjEzOTc5ODc4", "avatar_url": "https://avatars.githubusercontent.com/u/13979878?v=4", "gravatar_id": "", "url": "https://api.github.com/users/GilgameshD", "html_url": "https://github.com/GilgameshD", "followers_url": "https://api.github.com/users/GilgameshD/followers", "following_url": "https://api.github.com/users/GilgameshD/following{/other_user}", "gists_url": "https://api.github.com/users/GilgameshD/gists{/gist_id}", "starred_url": "https://api.github.com/users/GilgameshD/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/GilgameshD/subscriptions", "organizations_url": "https://api.github.com/users/GilgameshD/orgs", "repos_url": "https://api.github.com/users/GilgameshD/repos", "events_url": "https://api.github.com/users/GilgameshD/events{/privacy}", "received_events_url": "https://api.github.com/users/GilgameshD/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37355/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37355/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37354
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37354/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37354/comments
https://api.github.com/repos/huggingface/transformers/issues/37354/events
https://github.com/huggingface/transformers/pull/37354
2,978,000,685
PR_kwDOCUB6oc6RsbB_
37,354
Preserve requires_grad in pre quantized model
{ "login": "jerryzh168", "id": 4958441, "node_id": "MDQ6VXNlcjQ5NTg0NDE=", "avatar_url": "https://avatars.githubusercontent.com/u/4958441?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jerryzh168", "html_url": "https://github.com/jerryzh168", "followers_url": "https://api.github.com/users/jerryzh168/followers", "following_url": "https://api.github.com/users/jerryzh168/following{/other_user}", "gists_url": "https://api.github.com/users/jerryzh168/gists{/gist_id}", "starred_url": "https://api.github.com/users/jerryzh168/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jerryzh168/subscriptions", "organizations_url": "https://api.github.com/users/jerryzh168/orgs", "repos_url": "https://api.github.com/users/jerryzh168/repos", "events_url": "https://api.github.com/users/jerryzh168/events{/privacy}", "received_events_url": "https://api.github.com/users/jerryzh168/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T21:06:58
2025-04-08T16:41:30
2025-04-08T16:41:30
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37354", "html_url": "https://github.com/huggingface/transformers/pull/37354", "diff_url": "https://github.com/huggingface/transformers/pull/37354.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37354.patch", "merged_at": "2025-04-08T16:41:30" }
Summary: discovered this when running lm-eval for some models, current code will set requires_grad to True always Test Plan: lm_eval --model hf --model_args pretrained=jerryzh168/phi4-torchao-gguf-q4_k --tasks hellaswag --device cuda:0 --batch_size 8 Reviewers: Subscribers: Tasks: Tags:
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37354/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37354/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37353
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37353/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37353/comments
https://api.github.com/repos/huggingface/transformers/issues/37353/events
https://github.com/huggingface/transformers/pull/37353
2,978,000,020
PR_kwDOCUB6oc6Rsa4j
37,353
Multiple llama4 fixe
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T21:06:34
2025-04-08T09:14:51
2025-04-08T09:14:49
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37353", "html_url": "https://github.com/huggingface/transformers/pull/37353", "diff_url": "https://github.com/huggingface/transformers/pull/37353.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37353.patch", "merged_at": "2025-04-08T09:14:49" }
# What does this PR do? - Fixed training with flex - Fixed inference with flex, no cache - Fixed full compile compatibility - Reduced overhead for the cache cc @Cyrilvallez
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37353/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37353/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37352
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37352/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37352/comments
https://api.github.com/repos/huggingface/transformers/issues/37352/events
https://github.com/huggingface/transformers/issues/37352
2,977,992,857
I_kwDOCUB6oc6xgJCZ
37,352
Llama 4 Scout w/ Flex Attention Fails
{ "login": "ardapekis", "id": 10730618, "node_id": "MDQ6VXNlcjEwNzMwNjE4", "avatar_url": "https://avatars.githubusercontent.com/u/10730618?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ardapekis", "html_url": "https://github.com/ardapekis", "followers_url": "https://api.github.com/users/ardapekis/followers", "following_url": "https://api.github.com/users/ardapekis/following{/other_user}", "gists_url": "https://api.github.com/users/ardapekis/gists{/gist_id}", "starred_url": "https://api.github.com/users/ardapekis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ardapekis/subscriptions", "organizations_url": "https://api.github.com/users/ardapekis/orgs", "repos_url": "https://api.github.com/users/ardapekis/repos", "events_url": "https://api.github.com/users/ardapekis/events{/privacy}", "received_events_url": "https://api.github.com/users/ardapekis/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-07T21:02:20
2025-04-07T21:07:45
2025-04-07T21:07:45
NONE
null
null
null
null
### System Info - `transformers` version: 4.51.0 - Platform: Linux-6.8.0-53-generic-x86_64-with-glibc2.35 - Python version: 3.11.10 - Huggingface_hub version: 0.30.1 - Safetensors version: 0.5.3 - Accelerate version: 1.6.0 - Accelerate config: not found - DeepSpeed version: 0.15.4 - PyTorch version (GPU?): 2.6.0+cu124 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using distributed or parallel set-up in script?: Y - Using GPU in script?: Y - GPU type: NVIDIA H200 ### Who can help? @ArthurZucker @zucchini-nlp @SunMarc ### Information - [x] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction Run the official code example for Llama 4 Scout: https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct#how-to-use-with-transformers ```python from transformers import AutoProcessor, Llama4ForConditionalGeneration import torch model_id = "meta-llama/Llama-4-Scout-17B-16E-Instruct" processor = AutoProcessor.from_pretrained(model_id) model = Llama4ForConditionalGeneration.from_pretrained( model_id, attn_implementation="flex_attention", device_map="auto", torch_dtype=torch.bfloat16, ) url1 = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/0052a70beed5bf71b92610a43a52df6d286cd5f3/diffusers/rabbit.jpg" url2 = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/datasets/cat_style_layout.png" messages = [ { "role": "user", "content": [ {"type": "image", "url": url1}, {"type": "image", "url": url2}, {"type": "text", "text": "Can you describe how these two images are similar, and how they differ?"}, ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate( **inputs, max_new_tokens=256, ) response = processor.batch_decode(outputs[:, inputs["input_ids"].shape[-1]:])[0] print(response) print(outputs[0]) ``` The following error results: ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[1], line 35 16 messages = [ 17 { 18 "role": "user", (...) 24 }, 25 ] 27 inputs = processor.apply_chat_template( 28 messages, 29 add_generation_prompt=True, (...) 32 return_tensors="pt", 33 ).to(model.device) ---> 35 outputs = model.generate( 36 **inputs, 37 max_new_tokens=256, 38 ) 40 response = processor.batch_decode(outputs[:, inputs["input_ids"].shape[-1]:])[0] 41 print(response) File /workspace/.venv/lib/python3.11/site-packages/torch/utils/_contextlib.py:116, in context_decorator.<locals>.decorate_context(*args, **kwargs) 113 @functools.wraps(func) 114 def decorate_context(*args, **kwargs): 115 with ctx_factory(): --> 116 return func(*args, **kwargs) File /workspace/.venv/lib/python3.11/site-packages/transformers/generation/utils.py:2460, in GenerationMixin.generate(self, inputs, generation_config, logits_processor, stopping_criteria, prefix_allowed_tokens_fn, synced_gpus, assistant_model, streamer, negative_prompt_ids, negative_prompt_attention_mask, use_model_defaults, **kwargs) 2452 input_ids, model_kwargs = self._expand_inputs_for_generation( 2453 input_ids=input_ids, 2454 expand_size=generation_config.num_return_sequences, 2455 is_encoder_decoder=self.config.is_encoder_decoder, 2456 **model_kwargs, 2457 ) 2459 # 12. run sample (it degenerates to greedy search when `generation_config.do_sample=False`) -> 2460 result = self._sample( 2461 input_ids, 2462 logits_processor=prepared_logits_processor, 2463 stopping_criteria=prepared_stopping_criteria, 2464 generation_config=generation_config, 2465 synced_gpus=synced_gpus, 2466 streamer=streamer, 2467 **model_kwargs, 2468 ) 2470 elif generation_mode in (GenerationMode.BEAM_SAMPLE, GenerationMode.BEAM_SEARCH): 2471 # 11. interleave input_ids with `num_beams` additional sequences per batch 2472 input_ids, model_kwargs = self._expand_inputs_for_generation( 2473 input_ids=input_ids, 2474 expand_size=generation_config.num_beams, 2475 is_encoder_decoder=self.config.is_encoder_decoder, 2476 **model_kwargs, 2477 ) File /workspace/.venv/lib/python3.11/site-packages/transformers/generation/utils.py:3426, in GenerationMixin._sample(self, input_ids, logits_processor, stopping_criteria, generation_config, synced_gpus, streamer, **model_kwargs) 3423 model_inputs.update({"output_hidden_states": output_hidden_states} if output_hidden_states else {}) 3425 if is_prefill: -> 3426 outputs = self(**model_inputs, return_dict=True) 3427 is_prefill = False 3428 else: File /workspace/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py:1739, in Module._wrapped_call_impl(self, *args, **kwargs) 1737 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc] 1738 else: -> 1739 return self._call_impl(*args, **kwargs) File /workspace/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py:1750, in Module._call_impl(self, *args, **kwargs) 1745 # If we don't have any hooks, we want to skip the rest of the logic in 1746 # this function, and just call forward. 1747 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks 1748 or _global_backward_pre_hooks or _global_backward_hooks 1749 or _global_forward_hooks or _global_forward_pre_hooks): -> 1750 return forward_call(*args, **kwargs) 1752 result = None 1753 called_always_called_hooks = set() File /workspace/.venv/lib/python3.11/site-packages/accelerate/hooks.py:176, in add_hook_to_module.<locals>.new_forward(module, *args, **kwargs) 174 output = module._old_forward(*args, **kwargs) 175 else: --> 176 output = module._old_forward(*args, **kwargs) 177 return module._hf_hook.post_forward(module, output) File /workspace/.venv/lib/python3.11/site-packages/transformers/models/llama4/modeling_llama4.py:1761, in Llama4ForConditionalGeneration.forward(self, input_ids, pixel_values, attention_mask, position_ids, past_key_values, inputs_embeds, vision_feature_layer, vision_feature_select_strategy, labels, use_cache, output_attentions, output_hidden_states, return_dict, cache_position, logits_to_keep, image_sizes, **lm_kwargs) 1757 inputs_embeds.masked_scatter_(expanded_mask, projected_vision_flat) 1759 inputs_embeds = inputs_embeds.view(original_inputs_embeds_shape) -> 1761 outputs = self.language_model( 1762 attention_mask=attention_mask, 1763 position_ids=position_ids, 1764 past_key_values=past_key_values, 1765 inputs_embeds=inputs_embeds, 1766 use_cache=use_cache, 1767 output_attentions=output_attentions, 1768 output_hidden_states=output_hidden_states, 1769 return_dict=return_dict, 1770 cache_position=cache_position, 1771 logits_to_keep=logits_to_keep, 1772 **lm_kwargs, 1773 ) 1775 logits = outputs[0] 1777 loss = None File /workspace/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py:1739, in Module._wrapped_call_impl(self, *args, **kwargs) 1737 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc] 1738 else: -> 1739 return self._call_impl(*args, **kwargs) File /workspace/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py:1750, in Module._call_impl(self, *args, **kwargs) 1745 # If we don't have any hooks, we want to skip the rest of the logic in 1746 # this function, and just call forward. 1747 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks 1748 or _global_backward_pre_hooks or _global_backward_hooks 1749 or _global_forward_hooks or _global_forward_pre_hooks): -> 1750 return forward_call(*args, **kwargs) 1752 result = None 1753 called_always_called_hooks = set() File /workspace/.venv/lib/python3.11/site-packages/transformers/models/llama4/modeling_llama4.py:1015, in Llama4ForCausalLM.forward(self, input_ids, attention_mask, position_ids, past_key_values, inputs_embeds, labels, use_cache, output_attentions, output_hidden_states, return_dict, cache_position, logits_to_keep, **kwargs) 1012 return_dict = return_dict if return_dict is not None else self.config.use_return_dict 1014 # decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn) -> 1015 outputs = self.model( 1016 input_ids=input_ids, 1017 attention_mask=attention_mask, 1018 position_ids=position_ids, 1019 past_key_values=past_key_values, 1020 inputs_embeds=inputs_embeds, 1021 use_cache=use_cache, 1022 output_attentions=output_attentions, 1023 output_hidden_states=output_hidden_states, 1024 return_dict=return_dict, 1025 cache_position=cache_position, 1026 **kwargs, 1027 ) 1029 hidden_states = outputs[0] 1030 # Only compute necessary logits, and do not upcast them to float if we are not computing the loss File /workspace/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py:1739, in Module._wrapped_call_impl(self, *args, **kwargs) 1737 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc] 1738 else: -> 1739 return self._call_impl(*args, **kwargs) File /workspace/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py:1750, in Module._call_impl(self, *args, **kwargs) 1745 # If we don't have any hooks, we want to skip the rest of the logic in 1746 # this function, and just call forward. 1747 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks 1748 or _global_backward_pre_hooks or _global_backward_hooks 1749 or _global_forward_hooks or _global_forward_pre_hooks): -> 1750 return forward_call(*args, **kwargs) 1752 result = None 1753 called_always_called_hooks = set() File /workspace/.venv/lib/python3.11/site-packages/transformers/models/llama4/modeling_llama4.py:669, in Llama4TextModel.forward(self, input_ids, attention_mask, position_ids, past_key_values, inputs_embeds, use_cache, output_attentions, output_hidden_states, return_dict, cache_position, **flash_attn_kwargs) 666 if position_ids is None: 667 position_ids = cache_position.unsqueeze(0) --> 669 causal_mask, chunk_causal_mask = self._update_causal_mask( 670 attention_mask, inputs_embeds, cache_position, past_key_values, output_attentions 671 ) 673 hidden_states = inputs_embeds 675 # create position embeddings to be shared across the decoder layers File /workspace/.venv/lib/python3.11/site-packages/transformers/models/llama4/modeling_llama4.py:779, in Llama4TextModel._update_causal_mask(self, attention_mask, input_tensor, cache_position, past_key_values, output_attentions, chunked_attention_mask) 775 offsets = (first_cache_position, max(last_cache_position - key_length, 0)) 776 chunked_attention_mask = make_flex_block_causal_mask( 777 attention_mask, self.config.attention_chunk_size, sequence_length, key_length, offsets=offsets 778 ) --> 779 attention_mask = make_flex_block_causal_mask( 780 attention_mask, 781 query_length=sequence_length, 782 key_length=past_key_values.get_max_cache_shape(), 783 offsets=None if sequence_length != 1 else (first_cache_position, 0), 784 ) 785 return attention_mask, chunked_attention_mask 786 if isinstance(attention_mask, BlockMask): File /workspace/.venv/lib/python3.11/site-packages/transformers/integrations/flex_attention.py:103, in make_flex_block_causal_mask(attention_mask_2d, attention_chunk_size, query_length, key_length, offsets) 74 def make_flex_block_causal_mask( 75 attention_mask_2d: torch.Tensor, 76 attention_chunk_size: Optional[int] = None, (...) 79 offsets: Optional[Tuple[Offset, Offset]] = None, 80 ) -> "BlockMask": 81 """ 82 Create a block causal document mask for a batch of sequences, both packed and unpacked. 83 Create Block causal logic and passing it into :func:`torch.nn.attention.flex_attention.create_block_mask`. (...) 101 BlockMask 102 """ --> 103 attention_mask_2d = torch.nn.functional.pad(attention_mask_2d, value=0, pad=(0, key_length)) 104 device = attention_mask_2d.device 105 document_ids = attention_mask_2d.clone() File /workspace/.venv/lib/python3.11/site-packages/torch/nn/functional.py:5209, in pad(input, pad, mode, value) 5202 if mode == "replicate": 5203 # Use slow decomp whose backward will be in terms of index_put. 5204 # importlib is required because the import cannot be top level 5205 # (cycle) and cannot be nested (TS doesn't support) 5206 return importlib.import_module( 5207 "torch._decomp.decompositions" 5208 )._replication_pad(input, pad) -> 5209 return torch._C._nn.pad(input, pad, mode, value) TypeError: pad(): argument 'pad' failed to unpack the object at pos 2 with error "type must be tuple of ints,but got NoneType" ``` ### Expected behavior I compared running with `attn_implementation="sdpa"` which seems to work. The output was: ``` The two images feature anthropomorphic animals, a rabbit and a cat, dressed in human-like attire. The rabbit is depicted standing on a dirt path with flowers on either side, while the cat sits on a stone pathway surrounded by greenery. **Similarities:** * Both characters are dressed in formal clothing, including jackets, vests, shirts, and bow ties. * They both have large eyes and appear to be looking directly at the viewer. * The backgrounds of both images feature natural settings, such as gardens or countryside scenes. **Differences:** * **Species:** The most obvious difference is that one character is a rabbit and the other is a cat. * **Pose:** The rabbit stands upright on two legs, while the cat sits on all fours. * **Attire:** Although both characters wear similar outfits, there are some differences in their attire. The rabbit's jacket appears longer and more worn, while the cat's jacket has a more tailored fit. * **Background:** While both backgrounds feature natural settings, the rabbit's background includes a house and a mountain range in the distance, whereas the cat's background focuses more on the immediate surroundings, with a house visible in the distance. * **Color scheme:** The overall color palette of the two images differs slightly, tensor([200000, 200005, 1556, ..., 55738, 17432, 24], device='cuda:0') ```
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37352/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37352/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37351
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37351/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37351/comments
https://api.github.com/repos/huggingface/transformers/issues/37351/events
https://github.com/huggingface/transformers/issues/37351
2,977,615,026
I_kwDOCUB6oc6xesyy
37,351
[`Llamma4`] Chunked Attention
{ "login": "vasqu", "id": 73884904, "node_id": "MDQ6VXNlcjczODg0OTA0", "avatar_url": "https://avatars.githubusercontent.com/u/73884904?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vasqu", "html_url": "https://github.com/vasqu", "followers_url": "https://api.github.com/users/vasqu/followers", "following_url": "https://api.github.com/users/vasqu/following{/other_user}", "gists_url": "https://api.github.com/users/vasqu/gists{/gist_id}", "starred_url": "https://api.github.com/users/vasqu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vasqu/subscriptions", "organizations_url": "https://api.github.com/users/vasqu/orgs", "repos_url": "https://api.github.com/users/vasqu/repos", "events_url": "https://api.github.com/users/vasqu/events{/privacy}", "received_events_url": "https://api.github.com/users/vasqu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-07T18:08:05
2025-04-08T11:48:08
2025-04-08T11:48:08
CONTRIBUTOR
null
null
null
null
### System Info - `transformers` version: 4.52.0.dev0 (around commit 8bbcdf54096efbbb8de6f1a4e73c6517edf344a8) - Platform: Linux-6.8.0-111057-tuxedo-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.30.1 - Safetensors version: 0.4.3 - Accelerate version: 0.34.2 - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (GPU?): 2.6.0+cu124 (True) - Tensorflow version (GPU?): 2.15.1 (True) - Flax version (CPU?/GPU?/TPU?): 0.7.0 (cpu) - Jax version: 0.4.13 - JaxLib version: 0.4.13 - Using distributed or parallel set-up in script?: <fill in> - Using GPU in script?: <fill in> - GPU type: NVIDIA GeForce RTX 3080 Ti Laptop GPU ### Who can help? @ArthurZucker @winglian (fyi) ### Information - [ ] The official example scripts - [x] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [x] My own task or dataset (give details below) ### Reproduction Because I'm GPU poor, I modified llama4 to only have one layer and a lower hidden size. Rough script: ```python import torch from transformers import AutoConfig, AutoTokenizer from transformers.models.llama4.modeling_llama4 import Llama4ForCausalLM config = AutoConfig.from_pretrained("meta-llama/Llama-4-Scout-17B-16E-Instruct").get_text_config() # modify config for debugging config._attn_implementation = "eager" # or "flex_attention", possibly also "sdpa" config.hidden_size = 128 config.num_hidden_layers = 1 config.attention_chunk_size = 3 # causes eager issues, leaving default causes issues in flex attention # some dummy data tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-4-Scout-17B-16E-Instruct") tokenizer.padding_side = "left" # irrelevant tbh input_text = ["What are we having for dinner?", "How are you?"] input_ids = tokenizer(input_text, padding=True, return_tensors="pt").to("cuda") # init module, half precision to save on vram test_module = Llama4ForCausalLM(config).to("cuda", torch.bfloat16) # simple forward pass test_module.forward(**input_ids) ``` This can cause various issues, e.g. - In eager: `RuntimeError: The size of tensor a (8) must match the size of tensor b (2) at non-singleton dimension 0` - In flex: `ValueError: block_mask was created for block_mask.shape=(2, 1, 8, tensor(8192, device='cuda:0')) but got q_len=8 and kv_len=8. (...)` - looks like https://github.com/huggingface/transformers/pull/37329#discussion_r2031019385 ### Expected behavior Chunked attention doesn't seem to be correctly handled atm. A lots of code does not enter this territory because of the fairly long context to even go over the required chunk size.
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37351/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37351/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37350
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37350/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37350/comments
https://api.github.com/repos/huggingface/transformers/issues/37350/events
https://github.com/huggingface/transformers/pull/37350
2,977,512,205
PR_kwDOCUB6oc6Rqv5S
37,350
Haocheng lu2
{ "login": "LuHC409", "id": 113956490, "node_id": "U_kgDOBsrWig", "avatar_url": "https://avatars.githubusercontent.com/u/113956490?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LuHC409", "html_url": "https://github.com/LuHC409", "followers_url": "https://api.github.com/users/LuHC409/followers", "following_url": "https://api.github.com/users/LuHC409/following{/other_user}", "gists_url": "https://api.github.com/users/LuHC409/gists{/gist_id}", "starred_url": "https://api.github.com/users/LuHC409/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LuHC409/subscriptions", "organizations_url": "https://api.github.com/users/LuHC409/orgs", "repos_url": "https://api.github.com/users/LuHC409/repos", "events_url": "https://api.github.com/users/LuHC409/events{/privacy}", "received_events_url": "https://api.github.com/users/LuHC409/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-04-07T17:19:38
2025-04-07T18:45:28
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37350", "html_url": "https://github.com/huggingface/transformers/pull/37350", "diff_url": "https://github.com/huggingface/transformers/pull/37350.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37350.patch", "merged_at": null }
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> This PR fixes an issue in the _preprocess function of the Qwen2VLImageProcessor class, located in: transformers/src/transformers/models/qwen2_vl/image_processing_qwen2_vl.py Previously, when the number of patches was not divisible by temporal_patch_size, the code mistakenly repeated the last patch temporal_patch_size - 1 times, which could cause overshooting. This PR corrects the padding logic by computing the exact number of repeats needed: pad_len = temporal_patch_size - (patches.shape[0] % temporal_patch_size) repeats = np.repeat(patches[-1][np.newaxis], pad_len, axis=0) Motivation and context This change ensures that the total number of temporal patches is always divisible by temporal_patch_size, without introducing unnecessary extra patches. It avoids shape mismatch or over-padding problems in the later reshape steps. Local Testing ✅ I have tested this change locally and confirmed that all tests pass. Fixes # (issue) https://github.com/huggingface/transformers/issues/37064 ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [yes ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37350/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37350/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/37349
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37349/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37349/comments
https://api.github.com/repos/huggingface/transformers/issues/37349/events
https://github.com/huggingface/transformers/pull/37349
2,977,494,193
PR_kwDOCUB6oc6RqsAi
37,349
Clean up the compressed-tensors integration
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T17:11:09
2025-04-07T17:46:13
2025-04-07T17:26:45
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37349", "html_url": "https://github.com/huggingface/transformers/pull/37349", "diff_url": "https://github.com/huggingface/transformers/pull/37349.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37349.patch", "merged_at": "2025-04-07T17:26:45" }
# What does this PR do? Cleanup compressed-tensors integration as no longer used for Llama4
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37349/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37349/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37348
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37348/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37348/comments
https://api.github.com/repos/huggingface/transformers/issues/37348/events
https://github.com/huggingface/transformers/pull/37348
2,977,252,168
PR_kwDOCUB6oc6Rp22e
37,348
Add bnb to the list of supported quantization methods for LLama4
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T15:32:10
2025-04-09T13:49:04
2025-04-07T18:34:07
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37348", "html_url": "https://github.com/huggingface/transformers/pull/37348", "diff_url": "https://github.com/huggingface/transformers/pull/37348.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37348.patch", "merged_at": "2025-04-07T18:34:06" }
# What does this PR do? This pr adds support for bitsandbytes quantization, and loading bnb quantized models in transformers. Some quantized Llama4 models can be found here : - https://huggingface.co/bnb-community/Llama-4-Scout-17B-16E-Instruct-bnb-4bit - https://huggingface.co/bnb-community/Llama-4-Scout-17B-16E-Instruct-bnb-8bit
{ "login": "MekkCyber", "id": 93391238, "node_id": "U_kgDOBZEJhg", "avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MekkCyber", "html_url": "https://github.com/MekkCyber", "followers_url": "https://api.github.com/users/MekkCyber/followers", "following_url": "https://api.github.com/users/MekkCyber/following{/other_user}", "gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}", "starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions", "organizations_url": "https://api.github.com/users/MekkCyber/orgs", "repos_url": "https://api.github.com/users/MekkCyber/repos", "events_url": "https://api.github.com/users/MekkCyber/events{/privacy}", "received_events_url": "https://api.github.com/users/MekkCyber/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37348/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37348/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37347
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37347/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37347/comments
https://api.github.com/repos/huggingface/transformers/issues/37347/events
https://github.com/huggingface/transformers/pull/37347
2,977,238,738
PR_kwDOCUB6oc6Rpz4e
37,347
Remove HQQ from caching allocator warmup
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-04-07T15:27:16
2025-04-07T16:33:50
2025-04-07T16:33:48
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37347", "html_url": "https://github.com/huggingface/transformers/pull/37347", "diff_url": "https://github.com/huggingface/transformers/pull/37347.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37347.patch", "merged_at": "2025-04-07T16:33:48" }
# What does this PR do? HQQ quantizer injects items in the state dict of the model which are neither parameters nor buffers, and do not seem to be moved to device with usual params (even though they are Tensor). See https://github.com/huggingface/transformers/issues/37263 here for the bug that was introduced when allowing all quantizers to go through the caching allocator warmup. So skipping this quantizer from allocation for now, but we truly need to standardize these quantizers.
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37347/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37347/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37346
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37346/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37346/comments
https://api.github.com/repos/huggingface/transformers/issues/37346/events
https://github.com/huggingface/transformers/pull/37346
2,977,090,399
PR_kwDOCUB6oc6RpTR5
37,346
Avoid build crashes when torch.version.xpu doesn't exist and fix Llama4 processor tests
{ "login": "Rocketknight1", "id": 12866554, "node_id": "MDQ6VXNlcjEyODY2NTU0", "avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Rocketknight1", "html_url": "https://github.com/Rocketknight1", "followers_url": "https://api.github.com/users/Rocketknight1/followers", "following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}", "gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}", "starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions", "organizations_url": "https://api.github.com/users/Rocketknight1/orgs", "repos_url": "https://api.github.com/users/Rocketknight1/repos", "events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}", "received_events_url": "https://api.github.com/users/Rocketknight1/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T14:37:36
2025-04-08T06:27:24
2025-04-07T16:05:54
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37346", "html_url": "https://github.com/huggingface/transformers/pull/37346", "diff_url": "https://github.com/huggingface/transformers/pull/37346.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37346.patch", "merged_at": "2025-04-07T16:05:54" }
Quick update to #37126 which breaks on my local machine because `torch.version.xpu` doesn't exist. I'm not sure which versions that exists for and which doesn't, but we can just use `getattr()` to avoid crashes in those cases either way.
{ "login": "Rocketknight1", "id": 12866554, "node_id": "MDQ6VXNlcjEyODY2NTU0", "avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Rocketknight1", "html_url": "https://github.com/Rocketknight1", "followers_url": "https://api.github.com/users/Rocketknight1/followers", "following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}", "gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}", "starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions", "organizations_url": "https://api.github.com/users/Rocketknight1/orgs", "repos_url": "https://api.github.com/users/Rocketknight1/repos", "events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}", "received_events_url": "https://api.github.com/users/Rocketknight1/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37346/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37346/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37345
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37345/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37345/comments
https://api.github.com/repos/huggingface/transformers/issues/37345/events
https://github.com/huggingface/transformers/issues/37345
2,977,004,178
I_kwDOCUB6oc6xcXqS
37,345
Improve `auxiliary_in_channels` default behavior in UperNet
{ "login": "simonreise", "id": 43753582, "node_id": "MDQ6VXNlcjQzNzUzNTgy", "avatar_url": "https://avatars.githubusercontent.com/u/43753582?v=4", "gravatar_id": "", "url": "https://api.github.com/users/simonreise", "html_url": "https://github.com/simonreise", "followers_url": "https://api.github.com/users/simonreise/followers", "following_url": "https://api.github.com/users/simonreise/following{/other_user}", "gists_url": "https://api.github.com/users/simonreise/gists{/gist_id}", "starred_url": "https://api.github.com/users/simonreise/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/simonreise/subscriptions", "organizations_url": "https://api.github.com/users/simonreise/orgs", "repos_url": "https://api.github.com/users/simonreise/repos", "events_url": "https://api.github.com/users/simonreise/events{/privacy}", "received_events_url": "https://api.github.com/users/simonreise/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 2648621985, "node_id": "MDU6TGFiZWwyNjQ4NjIxOTg1", "url": "https://api.github.com/repos/huggingface/transformers/labels/Feature%20request", "name": "Feature request", "color": "FBCA04", "default": false, "description": "Request for a new feature" }, { "id": 5769473378, "node_id": "LA_kwDOCUB6oc8AAAABV-MtYg", "url": "https://api.github.com/repos/huggingface/transformers/labels/Vision", "name": "Vision", "color": "C079EF", "default": false, "description": "" } ]
closed
false
null
[]
null
[]
2025-04-07T14:08:53
2025-06-17T12:57:43
2025-06-17T12:57:43
CONTRIBUTOR
null
null
null
null
### Feature request Now the number of input channels in auxiliary UperNet FCN Head is controlled by `auxiliary_in_channels` parameter in UperNetConfig, which is set to 384 by default. Not every backbone have 384 channels by default, so sometimes user have to set this parameter manually. I propose to change the default model behaviour to automatically handle the number of input channels but keep the `auxiliary_in_channels` parameter with `None` as a default value so it still can be set manually by user if they need it. ### Motivation Now the number of input channels in auxiliary UperNet FCN Head is controlled by `auxiliary_in_channels` parameter in UperNetConfig, which is set to 384 by default. It works nice with some backbones (like Swin and Convnext) but crashes with backbones like BiT or ResNet. So, now, if user wants to use some backbones, they have to set the parameter manually, which is frustrating and it is not always straightforward which value you should use with every specific backbone. ### Your contribution However, in most cases this behaviour can be automated. I propose to set `auxiliary_in_channels` default value to None, so by default the model will handle the number of input channels automatically, but the parameter is still can be set by user if they need it. I propose to add `in_channels` parameter to `self.auxiliary_head` and set `self.in_channels` from `config.auxiliary_in_channels` if it is not None or from `in_channels` if it is None. `UperNetForSemanticSegmentation.__init__` ``` # Old # self.auxiliary_head = UperNetFCNHead(config) if config.use_auxiliary_head else None # New self.auxiliary_head = UperNetFCNHead(config, in_channels=self.backbone.channels) if config.use_auxiliary_head else None ``` ``` class UperNetFCNHead(nn.Module): def __init__( self, config, in_channels, in_index: int = 2, kernel_size: int = 3, dilation: Union[int, Tuple[int, int]] = 1 ) -> None: super().__init__() self.config = config # Old #self.in_channels = config.auxiliary_in_channels # New self.in_channels = in_channels[in_index] if config.auxiliary_in_channels is None else config.auxiliary_in_channels ``` I tested it with BEiT, BiT, ConvNeXT, ConvNeXTV2, DINOV2, DINOV2WithRegisters, FocalNet, Hiera, PVTV2, ResNet, Swin, SwinV2 and ViTDet backbones.
{ "login": "simonreise", "id": 43753582, "node_id": "MDQ6VXNlcjQzNzUzNTgy", "avatar_url": "https://avatars.githubusercontent.com/u/43753582?v=4", "gravatar_id": "", "url": "https://api.github.com/users/simonreise", "html_url": "https://github.com/simonreise", "followers_url": "https://api.github.com/users/simonreise/followers", "following_url": "https://api.github.com/users/simonreise/following{/other_user}", "gists_url": "https://api.github.com/users/simonreise/gists{/gist_id}", "starred_url": "https://api.github.com/users/simonreise/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/simonreise/subscriptions", "organizations_url": "https://api.github.com/users/simonreise/orgs", "repos_url": "https://api.github.com/users/simonreise/repos", "events_url": "https://api.github.com/users/simonreise/events{/privacy}", "received_events_url": "https://api.github.com/users/simonreise/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37345/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37345/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37344
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37344/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37344/comments
https://api.github.com/repos/huggingface/transformers/issues/37344/events
https://github.com/huggingface/transformers/pull/37344
2,976,730,541
PR_kwDOCUB6oc6RoDzy
37,344
Unhardcode use_chunked_attention, fix no_rope_layers
{ "login": "pcuenca", "id": 1177582, "node_id": "MDQ6VXNlcjExNzc1ODI=", "avatar_url": "https://avatars.githubusercontent.com/u/1177582?v=4", "gravatar_id": "", "url": "https://api.github.com/users/pcuenca", "html_url": "https://github.com/pcuenca", "followers_url": "https://api.github.com/users/pcuenca/followers", "following_url": "https://api.github.com/users/pcuenca/following{/other_user}", "gists_url": "https://api.github.com/users/pcuenca/gists{/gist_id}", "starred_url": "https://api.github.com/users/pcuenca/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pcuenca/subscriptions", "organizations_url": "https://api.github.com/users/pcuenca/orgs", "repos_url": "https://api.github.com/users/pcuenca/repos", "events_url": "https://api.github.com/users/pcuenca/events{/privacy}", "received_events_url": "https://api.github.com/users/pcuenca/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T12:39:05
2025-04-29T18:02:29
2025-04-29T18:02:29
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37344", "html_url": "https://github.com/huggingface/transformers/pull/37344", "diff_url": "https://github.com/huggingface/transformers/pull/37344.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37344.patch", "merged_at": null }
Not sure if this was already in the works.
{ "login": "pcuenca", "id": 1177582, "node_id": "MDQ6VXNlcjExNzc1ODI=", "avatar_url": "https://avatars.githubusercontent.com/u/1177582?v=4", "gravatar_id": "", "url": "https://api.github.com/users/pcuenca", "html_url": "https://github.com/pcuenca", "followers_url": "https://api.github.com/users/pcuenca/followers", "following_url": "https://api.github.com/users/pcuenca/following{/other_user}", "gists_url": "https://api.github.com/users/pcuenca/gists{/gist_id}", "starred_url": "https://api.github.com/users/pcuenca/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pcuenca/subscriptions", "organizations_url": "https://api.github.com/users/pcuenca/orgs", "repos_url": "https://api.github.com/users/pcuenca/repos", "events_url": "https://api.github.com/users/pcuenca/events{/privacy}", "received_events_url": "https://api.github.com/users/pcuenca/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37344/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37344/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37343
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37343/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37343/comments
https://api.github.com/repos/huggingface/transformers/issues/37343/events
https://github.com/huggingface/transformers/pull/37343
2,976,643,609
PR_kwDOCUB6oc6Rnwxc
37,343
Use Python 3.9 syntax in tests
{ "login": "cyyever", "id": 17618148, "node_id": "MDQ6VXNlcjE3NjE4MTQ4", "avatar_url": "https://avatars.githubusercontent.com/u/17618148?v=4", "gravatar_id": "", "url": "https://api.github.com/users/cyyever", "html_url": "https://github.com/cyyever", "followers_url": "https://api.github.com/users/cyyever/followers", "following_url": "https://api.github.com/users/cyyever/following{/other_user}", "gists_url": "https://api.github.com/users/cyyever/gists{/gist_id}", "starred_url": "https://api.github.com/users/cyyever/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cyyever/subscriptions", "organizations_url": "https://api.github.com/users/cyyever/orgs", "repos_url": "https://api.github.com/users/cyyever/repos", "events_url": "https://api.github.com/users/cyyever/events{/privacy}", "received_events_url": "https://api.github.com/users/cyyever/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T12:06:37
2025-04-09T02:08:01
2025-04-08T12:12:08
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37343", "html_url": "https://github.com/huggingface/transformers/pull/37343", "diff_url": "https://github.com/huggingface/transformers/pull/37343.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37343.patch", "merged_at": "2025-04-08T12:12:08" }
# What does this PR do? A follow-up work to fix tests. The changes were made by executing ``` pyupgrade --py39-plus tests/**/*py ```
{ "login": "ydshieh", "id": 2521628, "node_id": "MDQ6VXNlcjI1MjE2Mjg=", "avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ydshieh", "html_url": "https://github.com/ydshieh", "followers_url": "https://api.github.com/users/ydshieh/followers", "following_url": "https://api.github.com/users/ydshieh/following{/other_user}", "gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}", "starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions", "organizations_url": "https://api.github.com/users/ydshieh/orgs", "repos_url": "https://api.github.com/users/ydshieh/repos", "events_url": "https://api.github.com/users/ydshieh/events{/privacy}", "received_events_url": "https://api.github.com/users/ydshieh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37343/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37343/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37342
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37342/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37342/comments
https://api.github.com/repos/huggingface/transformers/issues/37342/events
https://github.com/huggingface/transformers/pull/37342
2,976,640,658
PR_kwDOCUB6oc6RnwH2
37,342
[vlm] adjust max length for special tokens
{ "login": "zucchini-nlp", "id": 100715397, "node_id": "U_kgDOBgDLhQ", "avatar_url": "https://avatars.githubusercontent.com/u/100715397?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zucchini-nlp", "html_url": "https://github.com/zucchini-nlp", "followers_url": "https://api.github.com/users/zucchini-nlp/followers", "following_url": "https://api.github.com/users/zucchini-nlp/following{/other_user}", "gists_url": "https://api.github.com/users/zucchini-nlp/gists{/gist_id}", "starred_url": "https://api.github.com/users/zucchini-nlp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zucchini-nlp/subscriptions", "organizations_url": "https://api.github.com/users/zucchini-nlp/orgs", "repos_url": "https://api.github.com/users/zucchini-nlp/repos", "events_url": "https://api.github.com/users/zucchini-nlp/events{/privacy}", "received_events_url": "https://api.github.com/users/zucchini-nlp/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T12:05:29
2025-04-16T18:49:21
2025-04-16T18:49:20
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37342", "html_url": "https://github.com/huggingface/transformers/pull/37342", "diff_url": "https://github.com/huggingface/transformers/pull/37342.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37342.patch", "merged_at": "2025-04-16T18:49:20" }
# What does this PR do? Fixes https://github.com/huggingface/transformers/issues/37222 Instead of raising errors, we adjust the max length manually and log the new length. This way is simpler, than the first idea I had because tokenizer's "overflow_tokens" do not work consistently for slow vs fast tokenizers TODO: forgot about PG and mistral For ex if a users sets max length to a small value and sets `truncation=True`, we will crop the input text including image tokens. It doesn't raise any error or warning, up until when inputs are forwarded to model and a mismatch occurs between `placeholder_in_text` and `image_hidden_state.shape`. The below ex from now on will return all image tokens, even though max length is 20. Also we'll raise warning, so users don't get confused as to why `20` is not the length they got ```python processor = LlavaProcessor.from_pretrained("llava-hf/llava-1.5-7b-hf") input_str = self.prepare_text_inputs(batch_size=2) image_input = self.prepare_image_inputs(batch_size=2) input_str = [f"<image>{sample}" for sample in input_str] inputs_truncated = processor( text=input_str, images=image_input, return_tensors="pt", truncation=True, padding=True, max_length=20, ) ```
{ "login": "zucchini-nlp", "id": 100715397, "node_id": "U_kgDOBgDLhQ", "avatar_url": "https://avatars.githubusercontent.com/u/100715397?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zucchini-nlp", "html_url": "https://github.com/zucchini-nlp", "followers_url": "https://api.github.com/users/zucchini-nlp/followers", "following_url": "https://api.github.com/users/zucchini-nlp/following{/other_user}", "gists_url": "https://api.github.com/users/zucchini-nlp/gists{/gist_id}", "starred_url": "https://api.github.com/users/zucchini-nlp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zucchini-nlp/subscriptions", "organizations_url": "https://api.github.com/users/zucchini-nlp/orgs", "repos_url": "https://api.github.com/users/zucchini-nlp/repos", "events_url": "https://api.github.com/users/zucchini-nlp/events{/privacy}", "received_events_url": "https://api.github.com/users/zucchini-nlp/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37342/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37342/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37341
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37341/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37341/comments
https://api.github.com/repos/huggingface/transformers/issues/37341/events
https://github.com/huggingface/transformers/pull/37341
2,976,490,415
PR_kwDOCUB6oc6RnPH-
37,341
fix derived berts `_init_weights`
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-04-07T11:07:15
2025-04-07T16:25:09
2025-04-07T16:25:07
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37341", "html_url": "https://github.com/huggingface/transformers/pull/37341", "diff_url": "https://github.com/huggingface/transformers/pull/37341.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37341.patch", "merged_at": "2025-04-07T16:25:07" }
# What does this PR do? As per the title. We prioritize this family for now as they seem to have corrupted weights on the hub, resulting in bad inits (see https://github.com/huggingface/transformers/pull/37070 as well). They are also used in optimum's tests!
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37341/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37341/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37340
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37340/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37340/comments
https://api.github.com/repos/huggingface/transformers/issues/37340/events
https://github.com/huggingface/transformers/pull/37340
2,976,383,347
PR_kwDOCUB6oc6Rm3gm
37,340
Remove runtime conditions for type checking
{ "login": "cyyever", "id": 17618148, "node_id": "MDQ6VXNlcjE3NjE4MTQ4", "avatar_url": "https://avatars.githubusercontent.com/u/17618148?v=4", "gravatar_id": "", "url": "https://api.github.com/users/cyyever", "html_url": "https://github.com/cyyever", "followers_url": "https://api.github.com/users/cyyever/followers", "following_url": "https://api.github.com/users/cyyever/following{/other_user}", "gists_url": "https://api.github.com/users/cyyever/gists{/gist_id}", "starred_url": "https://api.github.com/users/cyyever/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cyyever/subscriptions", "organizations_url": "https://api.github.com/users/cyyever/orgs", "repos_url": "https://api.github.com/users/cyyever/repos", "events_url": "https://api.github.com/users/cyyever/events{/privacy}", "received_events_url": "https://api.github.com/users/cyyever/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T10:25:08
2025-07-17T13:47:40
2025-07-16T11:36:48
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37340", "html_url": "https://github.com/huggingface/transformers/pull/37340", "diff_url": "https://github.com/huggingface/transformers/pull/37340.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37340.patch", "merged_at": "2025-07-16T11:36:48" }
# What does this PR do? Linters aren't smart enough to evaluate the conditions. Fixes #37339
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37340/reactions", "total_count": 3, "+1": 3, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37340/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37339
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37339/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37339/comments
https://api.github.com/repos/huggingface/transformers/issues/37339/events
https://github.com/huggingface/transformers/issues/37339
2,976,240,576
I_kwDOCUB6oc6xZdPA
37,339
Mypy errors since v4.51.0
{ "login": "jc-louis", "id": 51329768, "node_id": "MDQ6VXNlcjUxMzI5NzY4", "avatar_url": "https://avatars.githubusercontent.com/u/51329768?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jc-louis", "html_url": "https://github.com/jc-louis", "followers_url": "https://api.github.com/users/jc-louis/followers", "following_url": "https://api.github.com/users/jc-louis/following{/other_user}", "gists_url": "https://api.github.com/users/jc-louis/gists{/gist_id}", "starred_url": "https://api.github.com/users/jc-louis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jc-louis/subscriptions", "organizations_url": "https://api.github.com/users/jc-louis/orgs", "repos_url": "https://api.github.com/users/jc-louis/repos", "events_url": "https://api.github.com/users/jc-louis/events{/privacy}", "received_events_url": "https://api.github.com/users/jc-louis/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-07T09:33:30
2025-07-28T12:29:42
2025-07-15T15:02:44
NONE
null
null
null
null
@cyyever this is a direct result of https://github.com/huggingface/transformers/pull/37022 which marked the library as typed. ```py from typing import reveal_type from transformers import Trainer, PreTrainedModel def mypy_errors(trainer: Trainer, model: PreTrainedModel) -> None: reveal_type(trainer) reveal_type(trainer.train()) trainer.train() model.dequantize() ``` Using `mypy test.py`, I get the following errors: ``` script.py:5: note: Revealed type is "def (*args: Any, **kwargs: Any) -> transformers.utils.dummy_pt_objects.Trainer" script.py:8: note: Revealed type is "transformers.utils.dummy_pt_objects.Trainer" script.py:9: error: "Trainer" has no attribute "train" [attr-defined] script.py:9: note: Revealed type is "Any" script.py:10: error: "Trainer" has no attribute "train" [attr-defined] script.py:11: error: "PreTrainedModel" has no attribute "dequantize" [attr-defined] ``` Theses errors are false positives, it seems like there is a config issue, all types are pulled from [dummy_pt_objects.py](https://github.com/huggingface/transformers/blob/main/src/transformers/utils/dummy_pt_objects.py) --- - `transformers` version: 4.51.0 - Platform: macOS-14.7.3-arm64-arm-64bit - Python version: 3.12.3
{ "login": "jc-louis", "id": 51329768, "node_id": "MDQ6VXNlcjUxMzI5NzY4", "avatar_url": "https://avatars.githubusercontent.com/u/51329768?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jc-louis", "html_url": "https://github.com/jc-louis", "followers_url": "https://api.github.com/users/jc-louis/followers", "following_url": "https://api.github.com/users/jc-louis/following{/other_user}", "gists_url": "https://api.github.com/users/jc-louis/gists{/gist_id}", "starred_url": "https://api.github.com/users/jc-louis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jc-louis/subscriptions", "organizations_url": "https://api.github.com/users/jc-louis/orgs", "repos_url": "https://api.github.com/users/jc-louis/repos", "events_url": "https://api.github.com/users/jc-louis/events{/privacy}", "received_events_url": "https://api.github.com/users/jc-louis/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37339/reactions", "total_count": 9, "+1": 9, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37339/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37338
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37338/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37338/comments
https://api.github.com/repos/huggingface/transformers/issues/37338/events
https://github.com/huggingface/transformers/pull/37338
2,976,235,157
PR_kwDOCUB6oc6RmXRl
37,338
[Docs] Move models to appropriate section
{ "login": "NielsRogge", "id": 48327001, "node_id": "MDQ6VXNlcjQ4MzI3MDAx", "avatar_url": "https://avatars.githubusercontent.com/u/48327001?v=4", "gravatar_id": "", "url": "https://api.github.com/users/NielsRogge", "html_url": "https://github.com/NielsRogge", "followers_url": "https://api.github.com/users/NielsRogge/followers", "following_url": "https://api.github.com/users/NielsRogge/following{/other_user}", "gists_url": "https://api.github.com/users/NielsRogge/gists{/gist_id}", "starred_url": "https://api.github.com/users/NielsRogge/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/NielsRogge/subscriptions", "organizations_url": "https://api.github.com/users/NielsRogge/orgs", "repos_url": "https://api.github.com/users/NielsRogge/repos", "events_url": "https://api.github.com/users/NielsRogge/events{/privacy}", "received_events_url": "https://api.github.com/users/NielsRogge/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T09:31:40
2025-04-22T16:23:15
2025-04-22T16:23:15
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37338", "html_url": "https://github.com/huggingface/transformers/pull/37338", "diff_url": "https://github.com/huggingface/transformers/pull/37338.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37338.patch", "merged_at": "2025-04-22T16:23:14" }
# What does this PR do? I noticed several multimodal models are in the text-only section, hence this PR moves them. cc @stevhliu
{ "login": "ydshieh", "id": 2521628, "node_id": "MDQ6VXNlcjI1MjE2Mjg=", "avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ydshieh", "html_url": "https://github.com/ydshieh", "followers_url": "https://api.github.com/users/ydshieh/followers", "following_url": "https://api.github.com/users/ydshieh/following{/other_user}", "gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}", "starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions", "organizations_url": "https://api.github.com/users/ydshieh/orgs", "repos_url": "https://api.github.com/users/ydshieh/repos", "events_url": "https://api.github.com/users/ydshieh/events{/privacy}", "received_events_url": "https://api.github.com/users/ydshieh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37338/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37338/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37337
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37337/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37337/comments
https://api.github.com/repos/huggingface/transformers/issues/37337/events
https://github.com/huggingface/transformers/pull/37337
2,976,081,700
PR_kwDOCUB6oc6Rl13m
37,337
Fix `init empty weights` without accelerate
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-04-07T08:40:20
2025-04-07T09:54:40
2025-04-07T09:37:30
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37337", "html_url": "https://github.com/huggingface/transformers/pull/37337", "diff_url": "https://github.com/huggingface/transformers/pull/37337.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37337.patch", "merged_at": "2025-04-07T09:37:30" }
# What does this PR do? As per the title. People started reporting the issue as they sometimes uses Transformers without Accelerate
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37337/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 1, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37337/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37336
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37336/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37336/comments
https://api.github.com/repos/huggingface/transformers/issues/37336/events
https://github.com/huggingface/transformers/issues/37336
2,976,080,457
I_kwDOCUB6oc6xY2JJ
37,336
ImportError: cannot import name 'HfEngine' from 'transformers.agents'
{ "login": "HariNuve", "id": 159748242, "node_id": "U_kgDOCYWQkg", "avatar_url": "https://avatars.githubusercontent.com/u/159748242?v=4", "gravatar_id": "", "url": "https://api.github.com/users/HariNuve", "html_url": "https://github.com/HariNuve", "followers_url": "https://api.github.com/users/HariNuve/followers", "following_url": "https://api.github.com/users/HariNuve/following{/other_user}", "gists_url": "https://api.github.com/users/HariNuve/gists{/gist_id}", "starred_url": "https://api.github.com/users/HariNuve/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/HariNuve/subscriptions", "organizations_url": "https://api.github.com/users/HariNuve/orgs", "repos_url": "https://api.github.com/users/HariNuve/repos", "events_url": "https://api.github.com/users/HariNuve/events{/privacy}", "received_events_url": "https://api.github.com/users/HariNuve/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T08:39:49
2025-04-07T12:14:03
2025-04-07T12:14:02
NONE
null
null
null
null
Tried out the follwing : ``` from transformers.agents import HfEngine, ReactJsonAgent llm_engine = HfEngine("meta-llama/Meta-Llama-3-8B-Instruct") agent = ReactJsonAgent( tools=[RetrieverTool(vectordb, all_sources)], llm_engine=llm_engine ) agent_output = agent.run("Please show me a LORA finetuning script") print("Final output:") print(agent_output) ``` But resulted with following error : ``` ImportError Traceback (most recent call last) Cell In[11], line 1 ----> 1 from transformers.agents import HfEngine, ReactJsonAgent 3 llm_engine = HfEngine("meta-llama/Meta-Llama-3-8B-Instruct") 5 agent = ReactJsonAgent( 6 tools=[RetrieverTool(vectordb, all_sources)], 7 llm_engine=llm_engine 8 ) ImportError: cannot import name 'HfEngine' from 'transformers.agents' (/home/paperspace/anaconda3/envs/doc_env/lib/python3.10/site-packages/transformers/agents/__init__.py) ``` I have followed :[Transformers Agents 2.0]( https://huggingface.co/blog/agents#what-is-an-agent)
{ "login": "HariNuve", "id": 159748242, "node_id": "U_kgDOCYWQkg", "avatar_url": "https://avatars.githubusercontent.com/u/159748242?v=4", "gravatar_id": "", "url": "https://api.github.com/users/HariNuve", "html_url": "https://github.com/HariNuve", "followers_url": "https://api.github.com/users/HariNuve/followers", "following_url": "https://api.github.com/users/HariNuve/following{/other_user}", "gists_url": "https://api.github.com/users/HariNuve/gists{/gist_id}", "starred_url": "https://api.github.com/users/HariNuve/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/HariNuve/subscriptions", "organizations_url": "https://api.github.com/users/HariNuve/orgs", "repos_url": "https://api.github.com/users/HariNuve/repos", "events_url": "https://api.github.com/users/HariNuve/events{/privacy}", "received_events_url": "https://api.github.com/users/HariNuve/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37336/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37336/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37335
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37335/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37335/comments
https://api.github.com/repos/huggingface/transformers/issues/37335/events
https://github.com/huggingface/transformers/pull/37335
2,976,027,279
PR_kwDOCUB6oc6Rlp_l
37,335
Update VITS model card
{ "login": "princepride", "id": 29850264, "node_id": "MDQ6VXNlcjI5ODUwMjY0", "avatar_url": "https://avatars.githubusercontent.com/u/29850264?v=4", "gravatar_id": "", "url": "https://api.github.com/users/princepride", "html_url": "https://github.com/princepride", "followers_url": "https://api.github.com/users/princepride/followers", "following_url": "https://api.github.com/users/princepride/following{/other_user}", "gists_url": "https://api.github.com/users/princepride/gists{/gist_id}", "starred_url": "https://api.github.com/users/princepride/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/princepride/subscriptions", "organizations_url": "https://api.github.com/users/princepride/orgs", "repos_url": "https://api.github.com/users/princepride/repos", "events_url": "https://api.github.com/users/princepride/events{/privacy}", "received_events_url": "https://api.github.com/users/princepride/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T08:21:09
2025-04-15T20:16:06
2025-04-15T20:16:06
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37335", "html_url": "https://github.com/huggingface/transformers/pull/37335", "diff_url": "https://github.com/huggingface/transformers/pull/37335.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37335.patch", "merged_at": "2025-04-15T20:16:06" }
# What does this PR do? This PR updates the VITS model card to follow the new Hugging Face model card format. - Adds framework and optimization badges - Updates the checkpoint discovery link to the official [[facebook?search_models=mms-tts](https://huggingface.co/facebook?search_models=mms-tts)](https://huggingface.co/facebook?search_models=mms-tts) collection - Moves model-specific usage tips (e.g., `uroman`, seed setting) into the `> [!TIP]` section - Includes `pipeline` and `AutoModel` code examples for easy usage This improves the usability and discoverability of the VITS model and aligns its documentation with the newer standards used in models like Whisper. Fixes # (no specific issue, doc enhancement) --- ## Before submitting - [x] This PR improves the documentation - [x] I’ve read the [[contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request)](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request) - [x] Documentation was updated accordingly ## Who can review? @eustlb (for speech models) @stevhliu (for documentation)
{ "login": "stevhliu", "id": 59462357, "node_id": "MDQ6VXNlcjU5NDYyMzU3", "avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stevhliu", "html_url": "https://github.com/stevhliu", "followers_url": "https://api.github.com/users/stevhliu/followers", "following_url": "https://api.github.com/users/stevhliu/following{/other_user}", "gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}", "starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions", "organizations_url": "https://api.github.com/users/stevhliu/orgs", "repos_url": "https://api.github.com/users/stevhliu/repos", "events_url": "https://api.github.com/users/stevhliu/events{/privacy}", "received_events_url": "https://api.github.com/users/stevhliu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37335/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37335/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37334
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37334/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37334/comments
https://api.github.com/repos/huggingface/transformers/issues/37334/events
https://github.com/huggingface/transformers/issues/37334
2,975,754,834
I_kwDOCUB6oc6xXmpS
37,334
Support LLMDet in transformers
{ "login": "fushh", "id": 71886569, "node_id": "MDQ6VXNlcjcxODg2NTY5", "avatar_url": "https://avatars.githubusercontent.com/u/71886569?v=4", "gravatar_id": "", "url": "https://api.github.com/users/fushh", "html_url": "https://github.com/fushh", "followers_url": "https://api.github.com/users/fushh/followers", "following_url": "https://api.github.com/users/fushh/following{/other_user}", "gists_url": "https://api.github.com/users/fushh/gists{/gist_id}", "starred_url": "https://api.github.com/users/fushh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fushh/subscriptions", "organizations_url": "https://api.github.com/users/fushh/orgs", "repos_url": "https://api.github.com/users/fushh/repos", "events_url": "https://api.github.com/users/fushh/events{/privacy}", "received_events_url": "https://api.github.com/users/fushh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 1843244711, "node_id": "MDU6TGFiZWwxODQzMjQ0NzEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/New%20model", "name": "New model", "color": "fbca04", "default": false, "description": "" } ]
open
false
null
[]
null
[]
2025-04-07T06:23:44
2025-06-18T10:45:35
null
NONE
null
null
null
null
### Model description Could you please kindly consider add [LLMDet](https://arxiv.org/abs/2501.18954) (CVPR2025 Highlight) to transformers, which is a next-generation open-vocabulary object detector. The architecture of LLMDet is similar to GroundingDino and most of the code can be reused. We have provide the code and the Hugginface-compatible checkpoints at [here](https://github.com/iSEE-Laboratory/LLMDet/tree/main/hf_model). ### Open source status - [x] The model implementation is available - [x] The model weights are available ### Provide useful links for the implementation paper: https://arxiv.org/abs/2501.18954 code: https://github.com/iSEE-Laboratory/LLMDet/tree/main/hf_model model: https://huggingface.co/fushh7/llmdet_swin_tiny_hf model: https://huggingface.co/fushh7/llmdet_swin_base_hf model: https://huggingface.co/fushh7/llmdet_swin_large_hf
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37334/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37334/timeline
null
null
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
false
https://api.github.com/repos/huggingface/transformers/issues/37333
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37333/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37333/comments
https://api.github.com/repos/huggingface/transformers/issues/37333/events
https://github.com/huggingface/transformers/issues/37333
2,975,742,051
I_kwDOCUB6oc6xXjhj
37,333
A shallow copy in groundingdino
{ "login": "fushh", "id": 71886569, "node_id": "MDQ6VXNlcjcxODg2NTY5", "avatar_url": "https://avatars.githubusercontent.com/u/71886569?v=4", "gravatar_id": "", "url": "https://api.github.com/users/fushh", "html_url": "https://github.com/fushh", "followers_url": "https://api.github.com/users/fushh/followers", "following_url": "https://api.github.com/users/fushh/following{/other_user}", "gists_url": "https://api.github.com/users/fushh/gists{/gist_id}", "starred_url": "https://api.github.com/users/fushh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fushh/subscriptions", "organizations_url": "https://api.github.com/users/fushh/orgs", "repos_url": "https://api.github.com/users/fushh/repos", "events_url": "https://api.github.com/users/fushh/events{/privacy}", "received_events_url": "https://api.github.com/users/fushh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 1990918270, "node_id": "MDU6TGFiZWwxOTkwOTE4Mjcw", "url": "https://api.github.com/repos/huggingface/transformers/labels/Good%20First%20Issue", "name": "Good First Issue", "color": "bbf794", "default": false, "description": "" }, { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-07T06:17:01
2025-05-30T13:02:20
2025-05-30T13:02:20
NONE
null
null
null
null
### System Info A bug in source code ### Who can help? _No response_ ### Information - [x] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction please see https://github.com/huggingface/transformers/blob/d1b92369ca193da49f9f7ecd01b08ece45c2c9aa/src/transformers/models/grounding_dino/modeling_grounding_dino.py#L2529-L2534 ### Expected behavior a deep copy
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37333/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37333/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37332
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37332/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37332/comments
https://api.github.com/repos/huggingface/transformers/issues/37332/events
https://github.com/huggingface/transformers/pull/37332
2,975,733,765
PR_kwDOCUB6oc6Rkqs7
37,332
Fix graph break in torch.compile when using FA2 with attention_mask=None and batch size > 1
{ "login": "efsotr", "id": 104755879, "node_id": "U_kgDOBj5ypw", "avatar_url": "https://avatars.githubusercontent.com/u/104755879?v=4", "gravatar_id": "", "url": "https://api.github.com/users/efsotr", "html_url": "https://github.com/efsotr", "followers_url": "https://api.github.com/users/efsotr/followers", "following_url": "https://api.github.com/users/efsotr/following{/other_user}", "gists_url": "https://api.github.com/users/efsotr/gists{/gist_id}", "starred_url": "https://api.github.com/users/efsotr/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/efsotr/subscriptions", "organizations_url": "https://api.github.com/users/efsotr/orgs", "repos_url": "https://api.github.com/users/efsotr/repos", "events_url": "https://api.github.com/users/efsotr/events{/privacy}", "received_events_url": "https://api.github.com/users/efsotr/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T06:12:58
2025-06-25T07:58:59
2025-06-25T07:58:34
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37332", "html_url": "https://github.com/huggingface/transformers/pull/37332", "diff_url": "https://github.com/huggingface/transformers/pull/37332.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37332.patch", "merged_at": "2025-06-25T07:58:34" }
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> Fixes partial https://github.com/huggingface/transformers/issues/37199#issue-2965516901 ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @ArthurZucker <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37332/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37332/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37331
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37331/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37331/comments
https://api.github.com/repos/huggingface/transformers/issues/37331/events
https://github.com/huggingface/transformers/pull/37331
2,975,708,414
PR_kwDOCUB6oc6RklPE
37,331
[fix] make legacy bnb code work
{ "login": "cyr0930", "id": 14088169, "node_id": "MDQ6VXNlcjE0MDg4MTY5", "avatar_url": "https://avatars.githubusercontent.com/u/14088169?v=4", "gravatar_id": "", "url": "https://api.github.com/users/cyr0930", "html_url": "https://github.com/cyr0930", "followers_url": "https://api.github.com/users/cyr0930/followers", "following_url": "https://api.github.com/users/cyr0930/following{/other_user}", "gists_url": "https://api.github.com/users/cyr0930/gists{/gist_id}", "starred_url": "https://api.github.com/users/cyr0930/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cyr0930/subscriptions", "organizations_url": "https://api.github.com/users/cyr0930/orgs", "repos_url": "https://api.github.com/users/cyr0930/repos", "events_url": "https://api.github.com/users/cyr0930/events{/privacy}", "received_events_url": "https://api.github.com/users/cyr0930/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T05:58:02
2025-04-22T09:17:29
2025-04-22T09:17:29
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37331", "html_url": "https://github.com/huggingface/transformers/pull/37331", "diff_url": "https://github.com/huggingface/transformers/pull/37331.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37331.patch", "merged_at": "2025-04-22T09:17:29" }
# What does this PR do? bnb 8bit optimizer related logic doesn't work anymore because optimizer class name has been changed. This logic set optim_bits to 32 instead of 8 to stabilize training with 8-bit optimizer. And legacy code apply this only to 8bit-Adam, so I changed it to be applied to all 8-bit optimizers. ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [x] Did you write any new necessary tests? ## Who can review? @SunMarc <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "SunMarc", "id": 57196510, "node_id": "MDQ6VXNlcjU3MTk2NTEw", "avatar_url": "https://avatars.githubusercontent.com/u/57196510?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SunMarc", "html_url": "https://github.com/SunMarc", "followers_url": "https://api.github.com/users/SunMarc/followers", "following_url": "https://api.github.com/users/SunMarc/following{/other_user}", "gists_url": "https://api.github.com/users/SunMarc/gists{/gist_id}", "starred_url": "https://api.github.com/users/SunMarc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SunMarc/subscriptions", "organizations_url": "https://api.github.com/users/SunMarc/orgs", "repos_url": "https://api.github.com/users/SunMarc/repos", "events_url": "https://api.github.com/users/SunMarc/events{/privacy}", "received_events_url": "https://api.github.com/users/SunMarc/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37331/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37331/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37330
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37330/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37330/comments
https://api.github.com/repos/huggingface/transformers/issues/37330/events
https://github.com/huggingface/transformers/pull/37330
2,975,675,769
PR_kwDOCUB6oc6RkeLe
37,330
Add fuyu Fast Image Processor
{ "login": "Aravind-11", "id": 42345018, "node_id": "MDQ6VXNlcjQyMzQ1MDE4", "avatar_url": "https://avatars.githubusercontent.com/u/42345018?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Aravind-11", "html_url": "https://github.com/Aravind-11", "followers_url": "https://api.github.com/users/Aravind-11/followers", "following_url": "https://api.github.com/users/Aravind-11/following{/other_user}", "gists_url": "https://api.github.com/users/Aravind-11/gists{/gist_id}", "starred_url": "https://api.github.com/users/Aravind-11/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Aravind-11/subscriptions", "organizations_url": "https://api.github.com/users/Aravind-11/orgs", "repos_url": "https://api.github.com/users/Aravind-11/repos", "events_url": "https://api.github.com/users/Aravind-11/events{/privacy}", "received_events_url": "https://api.github.com/users/Aravind-11/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-07T05:36:27
2025-04-13T04:22:04
2025-04-13T04:22:04
CONTRIBUTOR
null
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37330", "html_url": "https://github.com/huggingface/transformers/pull/37330", "diff_url": "https://github.com/huggingface/transformers/pull/37330.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37330.patch", "merged_at": null }
# What does this PR do? This PR introduces `FuyuImageProcessorFast`, providing a faster alternative to the original `FuyuImageProcessor` by leveraging `torchvision` for image transformations. Key changes include: - Implementation of `FuyuImageProcessorFast` inheriting from `BaseImageProcessorFast`. - Adaptation of Fuyu-specific resize and padding logic using `torchvision.transforms.functional`. - Updates to `tests/models/fuyu/test_image_processing_fuyu.py` to include the fast processor, override save/load tests, and adjust tolerances for equivalence checks. All Fuyu image processing tests now pass. - Addition of documentation for `FuyuImageProcessorFast` and update of the main usage example to recommend `AutoProcessor` for loading. Fixes #36978 ## Before submitting - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? https://github.com/huggingface/transformers/issues/36978 - [x] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [x] Did you write any new necessary tests? ## Who can review? @yonigozlan
{ "login": "Aravind-11", "id": 42345018, "node_id": "MDQ6VXNlcjQyMzQ1MDE4", "avatar_url": "https://avatars.githubusercontent.com/u/42345018?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Aravind-11", "html_url": "https://github.com/Aravind-11", "followers_url": "https://api.github.com/users/Aravind-11/followers", "following_url": "https://api.github.com/users/Aravind-11/following{/other_user}", "gists_url": "https://api.github.com/users/Aravind-11/gists{/gist_id}", "starred_url": "https://api.github.com/users/Aravind-11/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Aravind-11/subscriptions", "organizations_url": "https://api.github.com/users/Aravind-11/orgs", "repos_url": "https://api.github.com/users/Aravind-11/repos", "events_url": "https://api.github.com/users/Aravind-11/events{/privacy}", "received_events_url": "https://api.github.com/users/Aravind-11/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37330/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37330/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37329
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37329/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37329/comments
https://api.github.com/repos/huggingface/transformers/issues/37329/events
https://github.com/huggingface/transformers/pull/37329
2,975,546,332
PR_kwDOCUB6oc6RkC32
37,329
more fixes for post-training llama4
{ "login": "winglian", "id": 381258, "node_id": "MDQ6VXNlcjM4MTI1OA==", "avatar_url": "https://avatars.githubusercontent.com/u/381258?v=4", "gravatar_id": "", "url": "https://api.github.com/users/winglian", "html_url": "https://github.com/winglian", "followers_url": "https://api.github.com/users/winglian/followers", "following_url": "https://api.github.com/users/winglian/following{/other_user}", "gists_url": "https://api.github.com/users/winglian/gists{/gist_id}", "starred_url": "https://api.github.com/users/winglian/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/winglian/subscriptions", "organizations_url": "https://api.github.com/users/winglian/orgs", "repos_url": "https://api.github.com/users/winglian/repos", "events_url": "https://api.github.com/users/winglian/events{/privacy}", "received_events_url": "https://api.github.com/users/winglian/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-04-07T03:49:13
2025-04-07T20:30:41
2025-04-07T19:20:23
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37329", "html_url": "https://github.com/huggingface/transformers/pull/37329", "diff_url": "https://github.com/huggingface/transformers/pull/37329.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37329.patch", "merged_at": "2025-04-07T19:20:23" }
# What does this PR do? Along with the changes in #37319 , these are also needed to train llama4. The guard on the `past_key_values` cache is because that will be None during training. this is a LoRA training on Scout <img width="1787" alt="Screenshot 2025-04-06 at 11 59 57 PM" src="https://github.com/user-attachments/assets/a44b5826-d255-475f-9f86-08dea837246e" /> Fixes # (issue) ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @ArthurZucker @SunMarc Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37329/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37329/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37328
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37328/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37328/comments
https://api.github.com/repos/huggingface/transformers/issues/37328/events
https://github.com/huggingface/transformers/pull/37328
2,975,424,024
PR_kwDOCUB6oc6Rjozo
37,328
Add QLIP Model
{ "login": "lavinal712", "id": 98888959, "node_id": "U_kgDOBeTs_w", "avatar_url": "https://avatars.githubusercontent.com/u/98888959?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lavinal712", "html_url": "https://github.com/lavinal712", "followers_url": "https://api.github.com/users/lavinal712/followers", "following_url": "https://api.github.com/users/lavinal712/following{/other_user}", "gists_url": "https://api.github.com/users/lavinal712/gists{/gist_id}", "starred_url": "https://api.github.com/users/lavinal712/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lavinal712/subscriptions", "organizations_url": "https://api.github.com/users/lavinal712/orgs", "repos_url": "https://api.github.com/users/lavinal712/repos", "events_url": "https://api.github.com/users/lavinal712/events{/privacy}", "received_events_url": "https://api.github.com/users/lavinal712/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 1843244711, "node_id": "MDU6TGFiZWwxODQzMjQ0NzEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/New%20model", "name": "New model", "color": "fbca04", "default": false, "description": "" } ]
closed
false
null
[]
null
[]
2025-04-07T01:54:50
2025-08-09T04:31:03
2025-08-09T04:30:17
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37328", "html_url": "https://github.com/huggingface/transformers/pull/37328", "diff_url": "https://github.com/huggingface/transformers/pull/37328.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37328.patch", "merged_at": null }
Fixes # (issue) https://github.com/huggingface/transformers/issues/37165 ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [x] Did you write any new necessary tests? ## Who can review? @amyeroberts, @qubvel This PR has a few TODO items: 1. Modify the comments. 2. Add documentation. Furthermore, I want to state that I am not the author of QLIP, but I hope to add this model to transformers.
{ "login": "lavinal712", "id": 98888959, "node_id": "U_kgDOBeTs_w", "avatar_url": "https://avatars.githubusercontent.com/u/98888959?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lavinal712", "html_url": "https://github.com/lavinal712", "followers_url": "https://api.github.com/users/lavinal712/followers", "following_url": "https://api.github.com/users/lavinal712/following{/other_user}", "gists_url": "https://api.github.com/users/lavinal712/gists{/gist_id}", "starred_url": "https://api.github.com/users/lavinal712/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lavinal712/subscriptions", "organizations_url": "https://api.github.com/users/lavinal712/orgs", "repos_url": "https://api.github.com/users/lavinal712/repos", "events_url": "https://api.github.com/users/lavinal712/events{/privacy}", "received_events_url": "https://api.github.com/users/lavinal712/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37328/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37328/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37327
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37327/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37327/comments
https://api.github.com/repos/huggingface/transformers/issues/37327/events
https://github.com/huggingface/transformers/pull/37327
2,975,137,839
PR_kwDOCUB6oc6RiuSQ
37,327
fix flex attn when optional args aren't passed
{ "login": "winglian", "id": 381258, "node_id": "MDQ6VXNlcjM4MTI1OA==", "avatar_url": "https://avatars.githubusercontent.com/u/381258?v=4", "gravatar_id": "", "url": "https://api.github.com/users/winglian", "html_url": "https://github.com/winglian", "followers_url": "https://api.github.com/users/winglian/followers", "following_url": "https://api.github.com/users/winglian/following{/other_user}", "gists_url": "https://api.github.com/users/winglian/gists{/gist_id}", "starred_url": "https://api.github.com/users/winglian/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/winglian/subscriptions", "organizations_url": "https://api.github.com/users/winglian/orgs", "repos_url": "https://api.github.com/users/winglian/repos", "events_url": "https://api.github.com/users/winglian/events{/privacy}", "received_events_url": "https://api.github.com/users/winglian/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-04-06T18:57:45
2025-04-07T20:50:52
2025-04-07T07:12:22
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37327", "html_url": "https://github.com/huggingface/transformers/pull/37327", "diff_url": "https://github.com/huggingface/transformers/pull/37327.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37327.patch", "merged_at": "2025-04-07T07:12:22" }
# What does this PR do? #37307 (llama4) introduced a regression in make_flex_block_causal_mask with new optional args that llama4 uses. It also added padding, but padding only works if the `key_length` isn't None. For all models except llama4, flex attention is now broken since none of them pass key_length, and currently they error with. ``` [rank3]: File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/torch/nn/functional.py", line 5209, in pad [rank3]: return torch._C._nn.pad(input, pad, mode, value) [rank3]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank3]: TypeError: pad(): argument 'pad' failed to unpack the object at pos 2 with error "type must be tuple of ints,but got NoneType" ``` Also, the batch size was likely mistakenly hard-coded to 1, which probably shouldn't be the case. Fixes # (issue) ## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @ArthurZucker Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface and @SunMarc - chat templates: @Rocketknight1 Integrations: - deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface - ray/raytune: @richardliaw, @amogkam - Big Model Inference: @SunMarc - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber Documentation: @stevhliu HF projects: - accelerate: [different repo](https://github.com/huggingface/accelerate) - datasets: [different repo](https://github.com/huggingface/datasets) - diffusers: [different repo](https://github.com/huggingface/diffusers) - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers) Maintained examples (not research project or legacy): - Flax: @Rocketknight1 - PyTorch: See Models above and tag the person corresponding to the modality of the example. - TensorFlow: @Rocketknight1 -->
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37327/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37327/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37326
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37326/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37326/comments
https://api.github.com/repos/huggingface/transformers/issues/37326/events
https://github.com/huggingface/transformers/issues/37326
2,975,117,234
I_kwDOCUB6oc6xVK-y
37,326
NameError: name 'init_empty_weights' is not defined
{ "login": "icode", "id": 972959, "node_id": "MDQ6VXNlcjk3Mjk1OQ==", "avatar_url": "https://avatars.githubusercontent.com/u/972959?v=4", "gravatar_id": "", "url": "https://api.github.com/users/icode", "html_url": "https://github.com/icode", "followers_url": "https://api.github.com/users/icode/followers", "following_url": "https://api.github.com/users/icode/following{/other_user}", "gists_url": "https://api.github.com/users/icode/gists{/gist_id}", "starred_url": "https://api.github.com/users/icode/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/icode/subscriptions", "organizations_url": "https://api.github.com/users/icode/orgs", "repos_url": "https://api.github.com/users/icode/repos", "events_url": "https://api.github.com/users/icode/events{/privacy}", "received_events_url": "https://api.github.com/users/icode/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-06T18:22:12
2025-10-15T09:58:22
2025-04-07T21:12:46
NONE
null
null
null
null
### System Info python 3.13 M4 macos 15.4 ### Who can help? _No response_ ### Information - [ ] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction do just ```python if torch.cuda.is_available(): device = torch.device("cuda") else: device = torch.device("cpu") model = CLIPModel.from_pretrained(MODEL_NAME).to(device) ``` ### Expected behavior ```log Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`. Traceback (most recent call last):   File "/Users/icode/Projects/self/fanfan/ai-backend/app.py", line 5, in <module>     import handlers   File "/Users/icode/Projects/self/fanfan/ai-backend/handlers.py", line 16, in <module>     model = CLIPModel.from_pretrained(MODEL_NAME).to(device)             ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^   File "/Users/icode/Projects/self/fanfan/ai-backend/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 279, in _wrapper     return func(*args, **kwargs)   File "/Users/icode/Projects/self/fanfan/ai-backend/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 4333, in from_pretrained     model_init_context = cls.get_init_context(is_quantized, _is_ds_init_called)   File "/Users/icode/Projects/self/fanfan/ai-backend/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 3736, in get_init_context     init_contexts = [no_init_weights(), init_empty_weights()]                                         ^^^^^^^^^^^^^^^^^^ NameError: name 'init_empty_weights' is not defined ```
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37326/reactions", "total_count": 18, "+1": 18, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37326/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37325
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37325/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37325/comments
https://api.github.com/repos/huggingface/transformers/issues/37325/events
https://github.com/huggingface/transformers/issues/37325
2,975,062,468
I_kwDOCUB6oc6xU9nE
37,325
Llama4TextExperts module implementation
{ "login": "Godofnothing", "id": 29793750, "node_id": "MDQ6VXNlcjI5NzkzNzUw", "avatar_url": "https://avatars.githubusercontent.com/u/29793750?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Godofnothing", "html_url": "https://github.com/Godofnothing", "followers_url": "https://api.github.com/users/Godofnothing/followers", "following_url": "https://api.github.com/users/Godofnothing/following{/other_user}", "gists_url": "https://api.github.com/users/Godofnothing/gists{/gist_id}", "starred_url": "https://api.github.com/users/Godofnothing/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Godofnothing/subscriptions", "organizations_url": "https://api.github.com/users/Godofnothing/orgs", "repos_url": "https://api.github.com/users/Godofnothing/repos", "events_url": "https://api.github.com/users/Godofnothing/events{/privacy}", "received_events_url": "https://api.github.com/users/Godofnothing/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 1834081910, "node_id": "MDU6TGFiZWwxODM0MDgxOTEw", "url": "https://api.github.com/repos/huggingface/transformers/labels/Usage", "name": "Usage", "color": "e28436", "default": false, "description": "General questions about the library" }, { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-06T16:40:52
2025-05-15T08:03:01
2025-05-15T08:03:01
NONE
null
null
null
null
### System Info Llama4 model family adopts `MoE` layer implementation for better efficiency. However, in the current [implementation](https://github.com/huggingface/transformers/blob/d1b92369ca193da49f9f7ecd01b08ece45c2c9aa/src/transformers/models/llama4/modeling_llama4.py#L85) MoE layer in fact performs an ordinary dense FFN forward pass with all experts being involved in the computation. One can see, that `gate_up_proj` matrix has the same shape as if all `num_experts` are active. <img width="726" alt="Image" src="https://github.com/user-attachments/assets/9cf64546-43f2-45d7-b2d1-f847f065a136" /> I guess the intent was to perform computation only for the experts **selected by router**. ### Who can help? @ArthurZucker ### Reproduction Any usage of the model ### Expected behavior Only experts chosen by the router are involved in computation
{ "login": "github-actions[bot]", "id": 41898282, "node_id": "MDM6Qm90NDE4OTgyODI=", "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", "gravatar_id": "", "url": "https://api.github.com/users/github-actions%5Bbot%5D", "html_url": "https://github.com/apps/github-actions", "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37325/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37325/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37324
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37324/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37324/comments
https://api.github.com/repos/huggingface/transformers/issues/37324/events
https://github.com/huggingface/transformers/pull/37324
2,974,877,945
PR_kwDOCUB6oc6Rh-Ld
37,324
Fix deepspeed with quantization
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-04-06T11:03:11
2025-04-07T13:27:16
2025-04-07T09:36:44
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37324", "html_url": "https://github.com/huggingface/transformers/pull/37324", "diff_url": "https://github.com/huggingface/transformers/pull/37324.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37324.patch", "merged_at": "2025-04-07T09:36:44" }
# What does this PR do? Alright, this should fix all deepspeed issues (finally). See here https://github.com/huggingface/transformers/pull/36963/files#diff-6b72b98c4c2dcfc6cc606843917733f5d858374fbc22a735ff483bbc0c1e63eaL4248-L4252, `low_cpu_mem_usage` was forbidden with deepspeed, but then still overriden here in the quantized case https://github.com/huggingface/transformers/pull/36963/files#diff-6b72b98c4c2dcfc6cc606843917733f5d858374fbc22a735ff483bbc0c1e63eaL4358-L4361 cc @stas00, @winglian @stas00, next steps will be making sure tests are robust, and once this is done we'll try to see how we can truly harmonize the paths, so that everything is taking the same one! But this will be done after the tests, to avoid potential similar issues as what happened these past days 🙃
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37324/reactions", "total_count": 2, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 2, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37324/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37323
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37323/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37323/comments
https://api.github.com/repos/huggingface/transformers/issues/37323/events
https://github.com/huggingface/transformers/issues/37323
2,974,830,272
I_kwDOCUB6oc6xUE7A
37,323
Llama 4: TypeError: pad(): argument 'pad' failed to unpack the object at pos 2 with error "type must be tuple of ints,but got NoneType"
{ "login": "daniel-dona", "id": 23705091, "node_id": "MDQ6VXNlcjIzNzA1MDkx", "avatar_url": "https://avatars.githubusercontent.com/u/23705091?v=4", "gravatar_id": "", "url": "https://api.github.com/users/daniel-dona", "html_url": "https://github.com/daniel-dona", "followers_url": "https://api.github.com/users/daniel-dona/followers", "following_url": "https://api.github.com/users/daniel-dona/following{/other_user}", "gists_url": "https://api.github.com/users/daniel-dona/gists{/gist_id}", "starred_url": "https://api.github.com/users/daniel-dona/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/daniel-dona/subscriptions", "organizations_url": "https://api.github.com/users/daniel-dona/orgs", "repos_url": "https://api.github.com/users/daniel-dona/repos", "events_url": "https://api.github.com/users/daniel-dona/events{/privacy}", "received_events_url": "https://api.github.com/users/daniel-dona/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-06T09:32:26
2025-04-07T07:21:14
2025-04-07T07:21:12
NONE
null
null
null
null
### System Info - `transformers` version: 4.51.0 - Platform: Linux-6.8.0-57-generic-x86_64-with-glibc2.39 - Python version: 3.12.3 - Huggingface_hub version: 0.30.1 - Safetensors version: 0.5.3 - Accelerate version: 1.6.0 - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (GPU?): 2.6.0+cu124 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using distributed or parallel set-up in script?: no - Using GPU in script?: yes - GPU type: NVIDIA GeForce RTX 3090 (Note: x4 GPU cluster) ### Who can help? _No response_ ### Information - [x] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction Steps: 1. Create a .venv with: ``` python3 -m venv .venv ``` 2. Activate the venv with: ``` source .venv/bin/activate ``` 3. Install libraries: ``` pip install transformers torch accelerate pillow torchvision flash_attn huggingface_hub huggingface_hub[hf_xet] ``` 4. Run HF repo sample code ```python from transformers import AutoProcessor, Llama4ForConditionalGeneration import torch model_id = "meta-llama/Llama-4-Scout-17B-16E-Instruct" processor = AutoProcessor.from_pretrained(model_id) model = Llama4ForConditionalGeneration.from_pretrained( model_id, attn_implementation="flex_attention", device_map="auto", torch_dtype=torch.bfloat16, ) url1 = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/0052a70beed5bf71b92610a43a52df6d286cd5f3/diffusers/rabbit.jpg" url2 = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/datasets/cat_style_layout.png" messages = [ { "role": "user", "content": [ {"type": "image", "url": url1}, {"type": "image", "url": url2}, {"type": "text", "text": "Can you describe how these two images are similar, and how they differ?"}, ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate( **inputs, max_new_tokens=256, ) response = processor.batch_decode(outputs[:, inputs["input_ids"].shape[-1]:])[0] print(response) print(outputs[0]) ``` 5. Got this error: ``` Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [05:30<00:00, 6.60s/it] Some parameters are on the meta device because they were offloaded to the cpu. Traceback (most recent call last): File "/home/dani/llama4.py", line 35, in <module> outputs = model.generate( ^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/transformers/generation/utils.py", line 2460, in generate result = self._sample( ^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/transformers/generation/utils.py", line 3426, in _sample outputs = self(**model_inputs, return_dict=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/accelerate/hooks.py", line 176, in new_forward output = module._old_forward(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/transformers/models/llama4/modeling_llama4.py", line 1761, in forward outputs = self.language_model( ^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/transformers/models/llama4/modeling_llama4.py", line 1015, in forward outputs = self.model( ^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/transformers/models/llama4/modeling_llama4.py", line 669, in forward causal_mask, chunk_causal_mask = self._update_causal_mask( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/transformers/models/llama4/modeling_llama4.py", line 779, in _update_causal_mask attention_mask = make_flex_block_causal_mask( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/transformers/integrations/flex_attention.py", line 103, in make_flex_block_causal_mask attention_mask_2d = torch.nn.functional.pad(attention_mask_2d, value=0, pad=(0, key_length)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dani/.venv/lib/python3.12/site-packages/torch/nn/functional.py", line 5209, in pad return torch._C._nn.pad(input, pad, mode, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: pad(): argument 'pad' failed to unpack the object at pos 2 with error "type must be tuple of ints,but got NoneType" ``` ### Expected behavior 1. Sample code to run successfully
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37323/reactions", "total_count": 5, "+1": 5, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37323/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37322
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37322/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37322/comments
https://api.github.com/repos/huggingface/transformers/issues/37322/events
https://github.com/huggingface/transformers/issues/37322
2,974,809,818
I_kwDOCUB6oc6xT_7a
37,322
Llama 4: eager attention results in wrong casual mask shape
{ "login": "Qubitium", "id": 417764, "node_id": "MDQ6VXNlcjQxNzc2NA==", "avatar_url": "https://avatars.githubusercontent.com/u/417764?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Qubitium", "html_url": "https://github.com/Qubitium", "followers_url": "https://api.github.com/users/Qubitium/followers", "following_url": "https://api.github.com/users/Qubitium/following{/other_user}", "gists_url": "https://api.github.com/users/Qubitium/gists{/gist_id}", "starred_url": "https://api.github.com/users/Qubitium/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Qubitium/subscriptions", "organizations_url": "https://api.github.com/users/Qubitium/orgs", "repos_url": "https://api.github.com/users/Qubitium/repos", "events_url": "https://api.github.com/users/Qubitium/events{/privacy}", "received_events_url": "https://api.github.com/users/Qubitium/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-06T08:56:04
2025-04-08T13:44:27
2025-04-08T13:44:26
CONTRIBUTOR
null
null
null
null
### System Info Latest transformers 4.51.0 ### Who can help? @ArthurZucker @SunMarc @MekkCyber I know you guys are probably burning an all-nighter due to Llama 4. =) ### Information - [ ] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction While adding GPTQModel support Llama 4 which does transformers inference at the layer/module level, we found issues where when eager attention is used, casual mask shapes are off by exactly factor of 2 or 4 for Llama 4: https://github.com/ModelCloud/GPTQModel/pull/1508 ![Image](https://github.com/user-attachments/assets/882c784c-40cc-41b5-a9c4-5e0611cc6c7c) ![Image](https://github.com/user-attachments/assets/7c64121c-3438-406a-86e2-21dd71eeef70) We are able to bypass this for now by setting `batch=1`, removing padding, and not passing `attention_mask` for inference. ### Expected behavior No error.
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37322/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37322/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37321
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37321/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37321/comments
https://api.github.com/repos/huggingface/transformers/issues/37321/events
https://github.com/huggingface/transformers/issues/37321
2,974,809,681
I_kwDOCUB6oc6xT_5R
37,321
Shape Error in Llama4VisionMLP2
{ "login": "priyammaz", "id": 60265010, "node_id": "MDQ6VXNlcjYwMjY1MDEw", "avatar_url": "https://avatars.githubusercontent.com/u/60265010?v=4", "gravatar_id": "", "url": "https://api.github.com/users/priyammaz", "html_url": "https://github.com/priyammaz", "followers_url": "https://api.github.com/users/priyammaz/followers", "following_url": "https://api.github.com/users/priyammaz/following{/other_user}", "gists_url": "https://api.github.com/users/priyammaz/gists{/gist_id}", "starred_url": "https://api.github.com/users/priyammaz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/priyammaz/subscriptions", "organizations_url": "https://api.github.com/users/priyammaz/orgs", "repos_url": "https://api.github.com/users/priyammaz/repos", "events_url": "https://api.github.com/users/priyammaz/events{/privacy}", "received_events_url": "https://api.github.com/users/priyammaz/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null } ]
closed
false
null
[]
null
[]
2025-04-06T08:55:44
2025-07-06T08:03:18
2025-07-06T08:03:18
NONE
null
null
null
null
### System Info https://github.com/huggingface/transformers/blob/d1b92369ca193da49f9f7ecd01b08ece45c2c9aa/src/transformers/models/llama4/modeling_llama4.py#L1096 Im pretty sure this should be: ```python self.fc2 = nn.Linear(config.projector_input_dim, config.projector_output_dim, bias=False) ``` ### Who can help? _No response_ ### Information - [ ] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below) ### Reproduction Nothing to reproduce, I just noticed a shape mistake, but i havent had a chance to run it personally yet! ### Expected behavior The output of fc1 should be the input of fc2, unless there is some hidden logic that I am missing
{ "login": "github-actions[bot]", "id": 41898282, "node_id": "MDM6Qm90NDE4OTgyODI=", "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", "gravatar_id": "", "url": "https://api.github.com/users/github-actions%5Bbot%5D", "html_url": "https://github.com/apps/github-actions", "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37321/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37321/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true
https://api.github.com/repos/huggingface/transformers/issues/37320
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37320/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37320/comments
https://api.github.com/repos/huggingface/transformers/issues/37320/events
https://github.com/huggingface/transformers/pull/37320
2,974,801,090
PR_kwDOCUB6oc6RhwdW
37,320
Added fast image processing for ImageGPT - initial commit
{ "login": "wadkisson", "id": 179639747, "node_id": "U_kgDOCrUVww", "avatar_url": "https://avatars.githubusercontent.com/u/179639747?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wadkisson", "html_url": "https://github.com/wadkisson", "followers_url": "https://api.github.com/users/wadkisson/followers", "following_url": "https://api.github.com/users/wadkisson/following{/other_user}", "gists_url": "https://api.github.com/users/wadkisson/gists{/gist_id}", "starred_url": "https://api.github.com/users/wadkisson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wadkisson/subscriptions", "organizations_url": "https://api.github.com/users/wadkisson/orgs", "repos_url": "https://api.github.com/users/wadkisson/repos", "events_url": "https://api.github.com/users/wadkisson/events{/privacy}", "received_events_url": "https://api.github.com/users/wadkisson/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-04-06T08:38:27
2025-05-07T12:37:26
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37320", "html_url": "https://github.com/huggingface/transformers/pull/37320", "diff_url": "https://github.com/huggingface/transformers/pull/37320.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37320.patch", "merged_at": null }
Summary - The PR modified the ImageGPT processor to implement PyTorch and TorchVision to replace NumPy and PIL operations for more efficient preprocessing. This PR keeps the same functionality of the original, slow processor but implemented BaseImageProcessorFast for more optimal speed. Notes - Hi everyone -- this is my first ever pull request! I tried to keep changes minimal and adhere to all the conventions I came across as strictly as I could. Any feedback on this would be greatly appreciated! Thanks guys.
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37320/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37320/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/37319
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37319/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37319/comments
https://api.github.com/repos/huggingface/transformers/issues/37319/events
https://github.com/huggingface/transformers/pull/37319
2,974,708,391
PR_kwDOCUB6oc6RhgB-
37,319
fix llama4 training
{ "login": "hiyouga", "id": 16256802, "node_id": "MDQ6VXNlcjE2MjU2ODAy", "avatar_url": "https://avatars.githubusercontent.com/u/16256802?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hiyouga", "html_url": "https://github.com/hiyouga", "followers_url": "https://api.github.com/users/hiyouga/followers", "following_url": "https://api.github.com/users/hiyouga/following{/other_user}", "gists_url": "https://api.github.com/users/hiyouga/gists{/gist_id}", "starred_url": "https://api.github.com/users/hiyouga/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hiyouga/subscriptions", "organizations_url": "https://api.github.com/users/hiyouga/orgs", "repos_url": "https://api.github.com/users/hiyouga/repos", "events_url": "https://api.github.com/users/hiyouga/events{/privacy}", "received_events_url": "https://api.github.com/users/hiyouga/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-04-06T05:45:04
2025-04-07T20:51:02
2025-04-07T07:24:44
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37319", "html_url": "https://github.com/huggingface/transformers/pull/37319", "diff_url": "https://github.com/huggingface/transformers/pull/37319.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37319.patch", "merged_at": "2025-04-07T07:24:44" }
# What does this PR do? Fix some issues during Llama 4 training using transformers. ![image](https://github.com/user-attachments/assets/0191e111-6ea5-4f72-a369-f72e58975f4f) Reproduce: https://github.com/hiyouga/LLaMA-Factory/pull/7611 ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @ArthurZucker
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37319/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37319/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/37318
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/37318/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/37318/comments
https://api.github.com/repos/huggingface/transformers/issues/37318/events
https://github.com/huggingface/transformers/pull/37318
2,974,681,732
PR_kwDOCUB6oc6Rhbp4
37,318
Remove fsspec dependency which isn't directly used by transformers
{ "login": "cyyever", "id": 17618148, "node_id": "MDQ6VXNlcjE3NjE4MTQ4", "avatar_url": "https://avatars.githubusercontent.com/u/17618148?v=4", "gravatar_id": "", "url": "https://api.github.com/users/cyyever", "html_url": "https://github.com/cyyever", "followers_url": "https://api.github.com/users/cyyever/followers", "following_url": "https://api.github.com/users/cyyever/following{/other_user}", "gists_url": "https://api.github.com/users/cyyever/gists{/gist_id}", "starred_url": "https://api.github.com/users/cyyever/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cyyever/subscriptions", "organizations_url": "https://api.github.com/users/cyyever/orgs", "repos_url": "https://api.github.com/users/cyyever/repos", "events_url": "https://api.github.com/users/cyyever/events{/privacy}", "received_events_url": "https://api.github.com/users/cyyever/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-04-06T04:32:23
2025-04-14T10:35:27
2025-04-14T10:02:28
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/37318", "html_url": "https://github.com/huggingface/transformers/pull/37318", "diff_url": "https://github.com/huggingface/transformers/pull/37318.diff", "patch_url": "https://github.com/huggingface/transformers/pull/37318.patch", "merged_at": "2025-04-14T10:02:28" }
# What does this PR do? As the title says.
{ "login": "ydshieh", "id": 2521628, "node_id": "MDQ6VXNlcjI1MjE2Mjg=", "avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ydshieh", "html_url": "https://github.com/ydshieh", "followers_url": "https://api.github.com/users/ydshieh/followers", "following_url": "https://api.github.com/users/ydshieh/following{/other_user}", "gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}", "starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions", "organizations_url": "https://api.github.com/users/ydshieh/orgs", "repos_url": "https://api.github.com/users/ydshieh/repos", "events_url": "https://api.github.com/users/ydshieh/events{/privacy}", "received_events_url": "https://api.github.com/users/ydshieh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/37318/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/37318/timeline
null
null
null
null
true
true