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/39035
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39035/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39035/comments
https://api.github.com/repos/huggingface/transformers/issues/39035/events
https://github.com/huggingface/transformers/pull/39035
3,175,914,979
PR_kwDOCUB6oc6cEogH
39,035
[Kyutai-STT] correct model type + model id
{ "login": "eustlb", "id": 94853470, "node_id": "U_kgDOBadZXg", "avatar_url": "https://avatars.githubusercontent.com/u/94853470?v=4", "gravatar_id": "", "url": "https://api.github.com/users/eustlb", "html_url": "https://github.com/eustlb", "followers_url": "https://api.github.com/users/eustlb/followers", "following_url": "https://api.github.com/users/eustlb/following{/other_user}", "gists_url": "https://api.github.com/users/eustlb/gists{/gist_id}", "starred_url": "https://api.github.com/users/eustlb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eustlb/subscriptions", "organizations_url": "https://api.github.com/users/eustlb/orgs", "repos_url": "https://api.github.com/users/eustlb/repos", "events_url": "https://api.github.com/users/eustlb/events{/privacy}", "received_events_url": "https://api.github.com/users/eustlb/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-25T14:37:33
2025-06-25T16:09:10
2025-06-25T16:09:01
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39035", "html_url": "https://github.com/huggingface/transformers/pull/39035", "diff_url": "https://github.com/huggingface/transformers/pull/39035.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39035.patch", "merged_at": "2025-06-25T16:09:01" }
# What does this PR do? Align with convention since we can 🤗
{ "login": "eustlb", "id": 94853470, "node_id": "U_kgDOBadZXg", "avatar_url": "https://avatars.githubusercontent.com/u/94853470?v=4", "gravatar_id": "", "url": "https://api.github.com/users/eustlb", "html_url": "https://github.com/eustlb", "followers_url": "https://api.github.com/users/eustlb/followers", "following_url": "https://api.github.com/users/eustlb/following{/other_user}", "gists_url": "https://api.github.com/users/eustlb/gists{/gist_id}", "starred_url": "https://api.github.com/users/eustlb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eustlb/subscriptions", "organizations_url": "https://api.github.com/users/eustlb/orgs", "repos_url": "https://api.github.com/users/eustlb/repos", "events_url": "https://api.github.com/users/eustlb/events{/privacy}", "received_events_url": "https://api.github.com/users/eustlb/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39035/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/39035/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39034
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39034/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39034/comments
https://api.github.com/repos/huggingface/transformers/issues/39034/events
https://github.com/huggingface/transformers/pull/39034
3,175,404,413
PR_kwDOCUB6oc6cC5sX
39,034
Update __init__.py
{ "login": "ReNothingg", "id": 180962586, "node_id": "U_kgDOCslFGg", "avatar_url": "https://avatars.githubusercontent.com/u/180962586?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ReNothingg", "html_url": "https://github.com/ReNothingg", "followers_url": "https://api.github.com/users/ReNothingg/followers", "following_url": "https://api.github.com/users/ReNothingg/following{/other_user}", "gists_url": "https://api.github.com/users/ReNothingg/gists{/gist_id}", "starred_url": "https://api.github.com/users/ReNothingg/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ReNothingg/subscriptions", "organizations_url": "https://api.github.com/users/ReNothingg/orgs", "repos_url": "https://api.github.com/users/ReNothingg/repos", "events_url": "https://api.github.com/users/ReNothingg/events{/privacy}", "received_events_url": "https://api.github.com/users/ReNothingg/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-25T12:07:10
2025-06-25T15:10:03
2025-06-25T15:10:02
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39034", "html_url": "https://github.com/huggingface/transformers/pull/39034", "diff_url": "https://github.com/huggingface/transformers/pull/39034.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39034.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 --> 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, @SunMarc and @qgallouedec - 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/39034/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/39034/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39033
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39033/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39033/comments
https://api.github.com/repos/huggingface/transformers/issues/39033/events
https://github.com/huggingface/transformers/pull/39033
3,175,363,230
PR_kwDOCUB6oc6cCwqc
39,033
Fix Bad Outputs in Fast Path for GraniteMoeHybrid
{ "login": "alex-jw-brooks", "id": 10740300, "node_id": "MDQ6VXNlcjEwNzQwMzAw", "avatar_url": "https://avatars.githubusercontent.com/u/10740300?v=4", "gravatar_id": "", "url": "https://api.github.com/users/alex-jw-brooks", "html_url": "https://github.com/alex-jw-brooks", "followers_url": "https://api.github.com/users/alex-jw-brooks/followers", "following_url": "https://api.github.com/users/alex-jw-brooks/following{/other_user}", "gists_url": "https://api.github.com/users/alex-jw-brooks/gists{/gist_id}", "starred_url": "https://api.github.com/users/alex-jw-brooks/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alex-jw-brooks/subscriptions", "organizations_url": "https://api.github.com/users/alex-jw-brooks/orgs", "repos_url": "https://api.github.com/users/alex-jw-brooks/repos", "events_url": "https://api.github.com/users/alex-jw-brooks/events{/privacy}", "received_events_url": "https://api.github.com/users/alex-jw-brooks/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-25T11:53:33
2025-06-27T12:45:15
2025-06-26T07:45:57
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39033", "html_url": "https://github.com/huggingface/transformers/pull/39033", "diff_url": "https://github.com/huggingface/transformers/pull/39033.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39033.patch", "merged_at": "2025-06-26T07:45:57" }
This PR fixes garbage output being produced when running granite moe hybrid models on the fast path; this is currently caused by inconsistent handling in `has_previous_state` on the fast path because the cache param was updated directly in the forward call of the state space layer in the slow path of bamba + updated through modular instead of handling the cache params at the end of forward like other state space models. Quick repro case: ```python from transformers import AutoModelForCausalLM, AutoTokenizer, set_seed import torch model_path="ibm-granite/granite-4.0-tiny-preview" device="cuda" model = AutoModelForCausalLM.from_pretrained( model_path, device_map=device, torch_dtype=torch.bfloat16, ) tokenizer = AutoTokenizer.from_pretrained( model_path ) conv = [{"role": "user", "content":"What is a rattlesnake? "}] input_ids = tokenizer.apply_chat_template(conv, return_tensors="pt", thinking=True, return_dict=True, add_generation_prompt=True).to(device) set_seed(42) output = model.generate( **input_ids, max_new_tokens=32, ) prediction = tokenizer.decode(output[0, input_ids["input_ids"].shape[1]:], skip_special_tokens=True) print(prediction) ``` Current output with `mamba_ssm` and `causal_conv1d` installed: ``` < the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the ``` vs without it ``` <think>A rattlesnake is a venomous snake species known for its distinctive rattle at the end of its tail, which 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? @ArthurZucker can you please take a look?
{ "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/39033/reactions", "total_count": 4, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 1, "rocket": 0, "eyes": 3 }
https://api.github.com/repos/huggingface/transformers/issues/39033/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39032
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39032/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39032/comments
https://api.github.com/repos/huggingface/transformers/issues/39032/events
https://github.com/huggingface/transformers/pull/39032
3,175,240,861
PR_kwDOCUB6oc6cCW1k
39,032
Enable nested config within config.json
{ "login": "LysandreJik", "id": 30755778, "node_id": "MDQ6VXNlcjMwNzU1Nzc4", "avatar_url": "https://avatars.githubusercontent.com/u/30755778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LysandreJik", "html_url": "https://github.com/LysandreJik", "followers_url": "https://api.github.com/users/LysandreJik/followers", "following_url": "https://api.github.com/users/LysandreJik/following{/other_user}", "gists_url": "https://api.github.com/users/LysandreJik/gists{/gist_id}", "starred_url": "https://api.github.com/users/LysandreJik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LysandreJik/subscriptions", "organizations_url": "https://api.github.com/users/LysandreJik/orgs", "repos_url": "https://api.github.com/users/LysandreJik/repos", "events_url": "https://api.github.com/users/LysandreJik/events{/privacy}", "received_events_url": "https://api.github.com/users/LysandreJik/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-25T11:12:07
2025-06-25T12:34:07
2025-06-25T12:34:07
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39032", "html_url": "https://github.com/huggingface/transformers/pull/39032", "diff_url": "https://github.com/huggingface/transformers/pull/39032.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39032.patch", "merged_at": null }
null
{ "login": "LysandreJik", "id": 30755778, "node_id": "MDQ6VXNlcjMwNzU1Nzc4", "avatar_url": "https://avatars.githubusercontent.com/u/30755778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LysandreJik", "html_url": "https://github.com/LysandreJik", "followers_url": "https://api.github.com/users/LysandreJik/followers", "following_url": "https://api.github.com/users/LysandreJik/following{/other_user}", "gists_url": "https://api.github.com/users/LysandreJik/gists{/gist_id}", "starred_url": "https://api.github.com/users/LysandreJik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LysandreJik/subscriptions", "organizations_url": "https://api.github.com/users/LysandreJik/orgs", "repos_url": "https://api.github.com/users/LysandreJik/repos", "events_url": "https://api.github.com/users/LysandreJik/events{/privacy}", "received_events_url": "https://api.github.com/users/LysandreJik/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39032/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/39032/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39031
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39031/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39031/comments
https://api.github.com/repos/huggingface/transformers/issues/39031/events
https://github.com/huggingface/transformers/pull/39031
3,175,218,497
PR_kwDOCUB6oc6cCR6a
39,031
[chat] Split chat/serve (built on top of lysandre's PR)
{ "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-06-25T11:04:00
2025-06-30T12:39:47
2025-06-30T12:35:30
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39031", "html_url": "https://github.com/huggingface/transformers/pull/39031", "diff_url": "https://github.com/huggingface/transformers/pull/39031.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39031.patch", "merged_at": "2025-06-30T12:35:30" }
# What does this PR do? Adds the following to #38443 - Streaming tool calls - Persistent KV cache across server calls - BC `chat` generation parameterization - docs
{ "login": "LysandreJik", "id": 30755778, "node_id": "MDQ6VXNlcjMwNzU1Nzc4", "avatar_url": "https://avatars.githubusercontent.com/u/30755778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LysandreJik", "html_url": "https://github.com/LysandreJik", "followers_url": "https://api.github.com/users/LysandreJik/followers", "following_url": "https://api.github.com/users/LysandreJik/following{/other_user}", "gists_url": "https://api.github.com/users/LysandreJik/gists{/gist_id}", "starred_url": "https://api.github.com/users/LysandreJik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LysandreJik/subscriptions", "organizations_url": "https://api.github.com/users/LysandreJik/orgs", "repos_url": "https://api.github.com/users/LysandreJik/repos", "events_url": "https://api.github.com/users/LysandreJik/events{/privacy}", "received_events_url": "https://api.github.com/users/LysandreJik/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39031/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/39031/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39030
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39030/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39030/comments
https://api.github.com/repos/huggingface/transformers/issues/39030/events
https://github.com/huggingface/transformers/issues/39030
3,175,050,820
I_kwDOCUB6oc69P25E
39,030
`AutoTokenizer.from_pretrained` does not propagate `token`
{ "login": "anakin87", "id": 44616784, "node_id": "MDQ6VXNlcjQ0NjE2Nzg0", "avatar_url": "https://avatars.githubusercontent.com/u/44616784?v=4", "gravatar_id": "", "url": "https://api.github.com/users/anakin87", "html_url": "https://github.com/anakin87", "followers_url": "https://api.github.com/users/anakin87/followers", "following_url": "https://api.github.com/users/anakin87/following{/other_user}", "gists_url": "https://api.github.com/users/anakin87/gists{/gist_id}", "starred_url": "https://api.github.com/users/anakin87/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/anakin87/subscriptions", "organizations_url": "https://api.github.com/users/anakin87/orgs", "repos_url": "https://api.github.com/users/anakin87/repos", "events_url": "https://api.github.com/users/anakin87/events{/privacy}", "received_events_url": "https://api.github.com/users/anakin87/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-06-25T10:07:32
2025-09-18T13:22:21
2025-09-18T13:22:21
CONTRIBUTOR
null
null
null
null
Since Transformers 4.52, the `Autotokenizer.from_pretrained` loading mechanism has changed and the `token` is not correctly propagated. ### System Info (Colab) - `transformers` version: 4.52.4 - Platform: Linux-6.1.123+-x86_64-with-glibc2.35 - Python version: 3.11.13 - Huggingface_hub version: 0.33.0 - Safetensors version: 0.5.3 - Accelerate version: 1.7.0 - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (GPU?): 2.6.0+cu124 (False) - Tensorflow version (GPU?): 2.18.0 (False) - Flax version (CPU?/GPU?/TPU?): 0.10.6 (cpu) - Jax version: 0.5.2 - JaxLib version: 0.5.1 - Using distributed or parallel set-up in script?: <fill in> ### Who can help? @Rocketknight1 @ArthurZucker @Wauplin I have the impression that this is related to #36588 ### Reproduction In this code example, I am trying to load a private tokenizer using the `token` parameter (not the env var). ```python import os from transformers import AutoTokenizer # we first make sure that the token is not present in environment variables # if the env var is present, THE BUG DOES NOT OCCUR os.environ.pop('HF_TOKEN', None) model = "deepset/bert-base-NER" # a valid private model I can access token = "..." tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path=model, token=token) ``` <details><summary>Error</summary> /usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_auth.py:86: UserWarning: Access to the secret `HF_TOKEN` has not been granted on this notebook. You will not be requested again. Please restart the session if you want to be prompted again. warnings.warn( --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) [/usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_http.py](https://localhost:8080/#) in hf_raise_for_status(response, endpoint_name) 408 try: --> 409 response.raise_for_status() 410 except HTTPError as e: 8 frames [/usr/local/lib/python3.11/dist-packages/requests/models.py](https://localhost:8080/#) in raise_for_status(self) 1023 if http_error_msg: -> 1024 raise HTTPError(http_error_msg, response=self) 1025 HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/api/models/deepset/bert-base-NER/tree/main/additional_chat_templates?recursive=False&expand=False The above exception was the direct cause of the following exception: RepositoryNotFoundError Traceback (most recent call last) [/tmp/ipython-input-6-4075835132.py](https://localhost:8080/#) in <cell line: 0>() 6 ----> 7 tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path=model, token=token) [/usr/local/lib/python3.11/dist-packages/transformers/models/auto/tokenization_auto.py](https://localhost:8080/#) in from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs) 1030 1031 if tokenizer_class_fast and (use_fast or tokenizer_class_py is None): -> 1032 return tokenizer_class_fast.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs) 1033 else: 1034 if tokenizer_class_py is not None: [/usr/local/lib/python3.11/dist-packages/transformers/tokenization_utils_base.py](https://localhost:8080/#) in from_pretrained(cls, pretrained_model_name_or_path, cache_dir, force_download, local_files_only, token, revision, trust_remote_code, *init_inputs, **kwargs) 1966 ) 1967 else: -> 1968 for template in list_repo_templates( 1969 pretrained_model_name_or_path, 1970 local_files_only=local_files_only, [/usr/local/lib/python3.11/dist-packages/transformers/utils/hub.py](https://localhost:8080/#) in list_repo_templates(repo_id, local_files_only, revision, cache_dir) 159 if not local_files_only: 160 try: --> 161 return [ 162 entry.path.removeprefix(f"{CHAT_TEMPLATE_DIR}/") 163 for entry in list_repo_tree( [/usr/local/lib/python3.11/dist-packages/transformers/utils/hub.py](https://localhost:8080/#) in <listcomp>(.0) 159 if not local_files_only: 160 try: --> 161 return [ 162 entry.path.removeprefix(f"{CHAT_TEMPLATE_DIR}/") 163 for entry in list_repo_tree( [/usr/local/lib/python3.11/dist-packages/huggingface_hub/hf_api.py](https://localhost:8080/#) in list_repo_tree(self, repo_id, path_in_repo, recursive, expand, revision, repo_type, token) 3166 encoded_path_in_repo = "/" + quote(path_in_repo, safe="") if path_in_repo else "" 3167 tree_url = f"{self.endpoint}/api/{repo_type}s/{repo_id}/tree/{revision}{encoded_path_in_repo}" -> 3168 for path_info in paginate(path=tree_url, headers=headers, params={"recursive": recursive, "expand": expand}): 3169 yield (RepoFile(**path_info) if path_info["type"] == "file" else RepoFolder(**path_info)) 3170 [/usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_pagination.py](https://localhost:8080/#) in paginate(path, params, headers) 35 session = get_session() 36 r = session.get(path, params=params, headers=headers) ---> 37 hf_raise_for_status(r) 38 yield from r.json() 39 [/usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_http.py](https://localhost:8080/#) in hf_raise_for_status(response, endpoint_name) 457 " https://huggingface.co/docs/huggingface_hub/authentication" 458 ) --> 459 raise _format(RepositoryNotFoundError, message, response) from e 460 461 elif response.status_code == 400: RepositoryNotFoundError: 401 Client Error. (Request ID: Root=1-685bc7f1-448cc03d560cc5bc2bc95865;1708f136-0e94-4e7d-a6b4-4e38a9c50920) Repository Not Found for url: https://huggingface.co/api/models/deepset/bert-base-NER/tree/main/additional_chat_templates?recursive=False&expand=False. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. For more details, see https://huggingface.co/docs/huggingface_hub/authentication Invalid username or password. </details> ### Expected behavior The tokenizer loads without errors.
{ "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/39030/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/39030/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/39029
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39029/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39029/comments
https://api.github.com/repos/huggingface/transformers/issues/39029/events
https://github.com/huggingface/transformers/pull/39029
3,174,745,653
PR_kwDOCUB6oc6cAukM
39,029
Fix key mapping for VLMs
{ "login": "bvantuan", "id": 37981884, "node_id": "MDQ6VXNlcjM3OTgxODg0", "avatar_url": "https://avatars.githubusercontent.com/u/37981884?v=4", "gravatar_id": "", "url": "https://api.github.com/users/bvantuan", "html_url": "https://github.com/bvantuan", "followers_url": "https://api.github.com/users/bvantuan/followers", "following_url": "https://api.github.com/users/bvantuan/following{/other_user}", "gists_url": "https://api.github.com/users/bvantuan/gists{/gist_id}", "starred_url": "https://api.github.com/users/bvantuan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bvantuan/subscriptions", "organizations_url": "https://api.github.com/users/bvantuan/orgs", "repos_url": "https://api.github.com/users/bvantuan/repos", "events_url": "https://api.github.com/users/bvantuan/events{/privacy}", "received_events_url": "https://api.github.com/users/bvantuan/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-06-25T08:35:30
2025-07-04T15:44:25
2025-07-01T07:47:54
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39029", "html_url": "https://github.com/huggingface/transformers/pull/39029", "diff_url": "https://github.com/huggingface/transformers/pull/39029.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39029.patch", "merged_at": "2025-07-01T07:47:54" }
# 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 #39004 Fixes key mapping for VLMs when they are extended by a custom subclass. ## 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. @zucchini-nlp <!-- 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, @SunMarc and @qgallouedec - 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": "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/39029/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/39029/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39028
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39028/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39028/comments
https://api.github.com/repos/huggingface/transformers/issues/39028/events
https://github.com/huggingface/transformers/pull/39028
3,174,552,348
PR_kwDOCUB6oc6cAFbK
39,028
Granite speech speedup + model saving bugfix
{ "login": "avihu111", "id": 39214195, "node_id": "MDQ6VXNlcjM5MjE0MTk1", "avatar_url": "https://avatars.githubusercontent.com/u/39214195?v=4", "gravatar_id": "", "url": "https://api.github.com/users/avihu111", "html_url": "https://github.com/avihu111", "followers_url": "https://api.github.com/users/avihu111/followers", "following_url": "https://api.github.com/users/avihu111/following{/other_user}", "gists_url": "https://api.github.com/users/avihu111/gists{/gist_id}", "starred_url": "https://api.github.com/users/avihu111/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/avihu111/subscriptions", "organizations_url": "https://api.github.com/users/avihu111/orgs", "repos_url": "https://api.github.com/users/avihu111/repos", "events_url": "https://api.github.com/users/avihu111/events{/privacy}", "received_events_url": "https://api.github.com/users/avihu111/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-25T07:33:36
2025-06-26T07:44:37
2025-06-26T07:44:17
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39028", "html_url": "https://github.com/huggingface/transformers/pull/39028", "diff_url": "https://github.com/huggingface/transformers/pull/39028.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39028.patch", "merged_at": "2025-06-26T07:44:17" }
# What does this PR do? ## Speeding up the encoder [Reverting](https://github.com/huggingface/transformers/pull/36801#discussion_r2013681886) Shaw's positional embedding calculation to einsum results in a significant speedup in both inference/training runtime. We found it to be x30 times faster than the current explicit dot product using bfloat16. I kept the explicit dot product in a comment for readability. I hope that it would be possible. ## Fixing issues with loading and saving with an adapter - When saving a checkpoint, the adapter config pointed to the original model, instead of the updated model - It fixes a bug, where we changed `_hf_peft_config_loaded` when saving - It reverts a tensor renaming that was triggered by adding an adapter. Maybe there's a better solution for the problems I was facing - I'll be happy to hear your opinion. I added comments on each code change, along with the necessary context and justification for the change. ## 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 @eustlb can you give that a look? 🙏 CC: @avishaiElmakies @alex-jw-brooks
{ "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/39028/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/39028/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39027
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39027/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39027/comments
https://api.github.com/repos/huggingface/transformers/issues/39027/events
https://github.com/huggingface/transformers/issues/39027
3,174,521,739
I_kwDOCUB6oc69N1uL
39,027
Issue with module.smart_apply(module._initialize_weights) in the initialize_weights Function of modeling_utils.py
{ "login": "DarwinYang", "id": 733525, "node_id": "MDQ6VXNlcjczMzUyNQ==", "avatar_url": "https://avatars.githubusercontent.com/u/733525?v=4", "gravatar_id": "", "url": "https://api.github.com/users/DarwinYang", "html_url": "https://github.com/DarwinYang", "followers_url": "https://api.github.com/users/DarwinYang/followers", "following_url": "https://api.github.com/users/DarwinYang/following{/other_user}", "gists_url": "https://api.github.com/users/DarwinYang/gists{/gist_id}", "starred_url": "https://api.github.com/users/DarwinYang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DarwinYang/subscriptions", "organizations_url": "https://api.github.com/users/DarwinYang/orgs", "repos_url": "https://api.github.com/users/DarwinYang/repos", "events_url": "https://api.github.com/users/DarwinYang/events{/privacy}", "received_events_url": "https://api.github.com/users/DarwinYang/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-06-25T07:21:37
2025-08-30T08:03:23
2025-08-30T08:03:23
NONE
null
null
null
null
### System Info - `transformers` version: 4.52.4 - Platform: Linux-5.4.282-1.el8.elrepo.x86_64-x86_64-with-glibc2.31 - Python version: 3.10.18 - Huggingface_hub version: 0.33.0 - Safetensors version: 0.5.3 - Accelerate version: 1.7.0 - Accelerate config: not found - DeepSpeed version: 0.14.4 - PyTorch version (GPU?): 2.7.1+cu126 (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> ### 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 ``` if not hasattr(torch.nn.Module, "smart_apply"): # This function is equivalent to `torch.nn.Module.apply`, except that it dynamically adjust the function # to apply as we go down the graph def smart_apply(self, fn): for module in self.children(): # We found a sub-model: recursively dispatch its own init function now! if hasattr(module, "_init_weights"): module.smart_apply(module._initialize_weights) else: module.smart_apply(fn) fn(self) return self ``` In fact, I have identified the same suspected bug in the following versions: v4.52.4, v4.52.3, v4.52.2, v4.52.1, and v4.52.0. As for other versions of Transformers, I have not analyzed them one by one. ### Expected behavior `module.smart_apply(module._init_weights)` In my local environment, I made the above adjustment to the line of code, and it allowed the Omni large model training to run successfully. Please have the developers of Transformers evaluate this.
{ "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/39027/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/39027/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/39026
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39026/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39026/comments
https://api.github.com/repos/huggingface/transformers/issues/39026/events
https://github.com/huggingface/transformers/issues/39026
3,174,371,494
I_kwDOCUB6oc69NRCm
39,026
CPMANT Model Fails to Run Following Official Tutorial
{ "login": "iugoood", "id": 61680846, "node_id": "MDQ6VXNlcjYxNjgwODQ2", "avatar_url": "https://avatars.githubusercontent.com/u/61680846?v=4", "gravatar_id": "", "url": "https://api.github.com/users/iugoood", "html_url": "https://github.com/iugoood", "followers_url": "https://api.github.com/users/iugoood/followers", "following_url": "https://api.github.com/users/iugoood/following{/other_user}", "gists_url": "https://api.github.com/users/iugoood/gists{/gist_id}", "starred_url": "https://api.github.com/users/iugoood/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/iugoood/subscriptions", "organizations_url": "https://api.github.com/users/iugoood/orgs", "repos_url": "https://api.github.com/users/iugoood/repos", "events_url": "https://api.github.com/users/iugoood/events{/privacy}", "received_events_url": "https://api.github.com/users/iugoood/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-06-25T06:26:11
2025-08-18T08:03:39
2025-08-18T08:03:39
NONE
null
null
null
null
### System Info Operating System: Linux Python Version: 3.10.16 Transformers Library Version: 4.51.0 Hardware Configuration: GPU A100 ### 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 Steps to Reproduce: import torch from transformers import AutoTokenizer, CpmAntForCausalLM tokenizer = AutoTokenizer.from_pretrained("openbmb/cpm-ant-10b") model = CpmAntForCausalLM.from_pretrained("openbmb/cpm-ant-10b") inputs = tokenizer("Hello, my dog is cute", return_tensors="pt") outputs = model(**inputs, labels=inputs["input_ids"]) loss = outputs.loss logits = outputs.logits ### Expected behavior The model should load and start training without any errors.
{ "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/39026/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/39026/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/39025
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39025/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39025/comments
https://api.github.com/repos/huggingface/transformers/issues/39025/events
https://github.com/huggingface/transformers/pull/39025
3,174,071,153
PR_kwDOCUB6oc6b-ebF
39,025
Add matchboxnet
{ "login": "Panga-az", "id": 70529525, "node_id": "MDQ6VXNlcjcwNTI5NTI1", "avatar_url": "https://avatars.githubusercontent.com/u/70529525?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Panga-az", "html_url": "https://github.com/Panga-az", "followers_url": "https://api.github.com/users/Panga-az/followers", "following_url": "https://api.github.com/users/Panga-az/following{/other_user}", "gists_url": "https://api.github.com/users/Panga-az/gists{/gist_id}", "starred_url": "https://api.github.com/users/Panga-az/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Panga-az/subscriptions", "organizations_url": "https://api.github.com/users/Panga-az/orgs", "repos_url": "https://api.github.com/users/Panga-az/repos", "events_url": "https://api.github.com/users/Panga-az/events{/privacy}", "received_events_url": "https://api.github.com/users/Panga-az/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-25T04:06:15
2025-06-30T13:01:10
2025-06-28T14:55:17
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39025", "html_url": "https://github.com/huggingface/transformers/pull/39025", "diff_url": "https://github.com/huggingface/transformers/pull/39025.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39025.patch", "merged_at": null }
# What does this PR do? This PR adds a new audio classification model: MatchboxNet, implementing the 1D Time-Channel Separable Convolutional Neural Network architecture for keyword spotting / speech commands recognition as described in the paper: > MatchboxNet: 1D Time-Channel Separable Convolutional Neural Network Architecture for Speech Commands Recognition > https://arxiv.org/abs/2004.08531 Specifically, it introduces: - `MatchboxConfig` (`configuration_matchboxnet.py`) to store hyperparameters (input_channels, num_classes, B, R, C, kernel_sizes, MFCC settings, etc.). - `MatchboxFeatureExtractor` (`feature_extraction_matchboxnet.py`) to extract MFCC features via torchaudio, pad/truncate to fixed length. - `MatchboxForAudioClassification` (`modeling_matchboxnet.py`) wrapping the MatchboxNet PyTorch module into a `PreTrainedModel` for HF Trainer/pipeline compatibility. - Auto mappings: - In `modeling_auto.py`: import `MatchboxConfig`, `MatchboxForAudioClassification` and add to `MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING` and `MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES`. - In `feature_extraction_auto.py`: import `MatchboxConfig`, `MatchboxFeatureExtractor` and add to `FEATURE_EXTRACTOR_MAPPING`. - In `configuration_auto.py`: add `"matchboxnet": "MatchboxConfig"` to `CONFIG_MAPPING_NAMES`, and map `MatchboxConfig` accordingly. - Tests under `tests/models/matchboxnet/` covering: - Configuration serialization/deserialization. - Feature extractor output shape and save/load. - Model forward, loss/backward with minimal sizes. - Pipeline audio-classification end-to-end on random input. - Updates to the top-level mapping imports in `src/transformers/models/auto/...`. No existing issue was open; this is a new feature addition. ## Before submitting - [x] This PR adds new model code, docs, and tests, not only a typo/docs fix. - [x] I have read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section. - [ ] (Optionally) If there was an existing discussion, link it here. For now, no issue was opened beforehand; feedback on design is welcome. - [x] Documentation is coming soon. - [x] New necessary tests are added under `tests/models/matchboxnet/`. - [x] Code is formatted with `black`/linted. - [x] I have run the full test suite locally (`pytest`) and all tests pass. ## Who can review? Anyone in the community is free to review once tests have passed. For speech/audio models, you may tag: - @eustlb (speech models) - @SunMarc (Trainer/Accelerate) - @Rocketknight1 (pipelines) Feel free to suggest others if relevant. --- ### Additional context / Motivation MatchboxNet is lightweight and efficient for keyword spotting, and it complements the existing audio models (e.g., Wav2Vec2, Whisper). By integrating it into Transformers: - Users can train custom keyword-spotting tasks with HF Trainer easily. - The feature extractor handles MFCCs transparently. - The model is available via `AutoModelForAudioClassification` and `pipeline("audio-classification")`. - It enriches the HF audio model zoo for on-device or low-resource settings. No extra dependencies beyond existing ones (`torch`, `torchaudio`, `transformers`, `datasets`, `numpy`) are introduced. --- ### Files changed - `src/transformers/models/matchboxnet/configuration_matchboxnet.py` - `src/transformers/models/matchboxnet/feature_extraction_matchboxnet.py` - `src/transformers/models/matchboxnet/modeling_matchboxnet.py` - `src/transformers/models/matchboxnet/__init__.py` - `src/transformers/__init__.py` - `src/transformers/models/auto/configuration_auto.py` (add `"matchboxnet"`) - `src/transformers/models/auto/modeling_auto.py` (map MatchboxNetConfig → MatchboxNetForAudioClassification) - `src/transformers/models/auto/feature_extraction_auto.py` (map MatchboxNetConfig → MatchboxNetForAudioClassification) - `tests/models/matchboxnet/test_configuration_matchboxnet.py` - `tests/models/matchboxnet/test_feature_extraction_matchboxnet.py` - `tests/models/matchboxnet/test_modeling_matchboxnet.py` - `tests/models/matchboxnet/test_pipeline_matchboxnet.py` --- ### How to test locally 1. **Install editable**: ```bash pip install -e .
{ "login": "Panga-az", "id": 70529525, "node_id": "MDQ6VXNlcjcwNTI5NTI1", "avatar_url": "https://avatars.githubusercontent.com/u/70529525?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Panga-az", "html_url": "https://github.com/Panga-az", "followers_url": "https://api.github.com/users/Panga-az/followers", "following_url": "https://api.github.com/users/Panga-az/following{/other_user}", "gists_url": "https://api.github.com/users/Panga-az/gists{/gist_id}", "starred_url": "https://api.github.com/users/Panga-az/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Panga-az/subscriptions", "organizations_url": "https://api.github.com/users/Panga-az/orgs", "repos_url": "https://api.github.com/users/Panga-az/repos", "events_url": "https://api.github.com/users/Panga-az/events{/privacy}", "received_events_url": "https://api.github.com/users/Panga-az/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39025/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 1 }
https://api.github.com/repos/huggingface/transformers/issues/39025/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39024
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39024/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39024/comments
https://api.github.com/repos/huggingface/transformers/issues/39024/events
https://github.com/huggingface/transformers/pull/39024
3,173,928,439
PR_kwDOCUB6oc6b-Acq
39,024
switch default xpu tp backend to pytorch built-in XCCL from pytorch 2.8
{ "login": "yao-matrix", "id": 7245027, "node_id": "MDQ6VXNlcjcyNDUwMjc=", "avatar_url": "https://avatars.githubusercontent.com/u/7245027?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yao-matrix", "html_url": "https://github.com/yao-matrix", "followers_url": "https://api.github.com/users/yao-matrix/followers", "following_url": "https://api.github.com/users/yao-matrix/following{/other_user}", "gists_url": "https://api.github.com/users/yao-matrix/gists{/gist_id}", "starred_url": "https://api.github.com/users/yao-matrix/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yao-matrix/subscriptions", "organizations_url": "https://api.github.com/users/yao-matrix/orgs", "repos_url": "https://api.github.com/users/yao-matrix/repos", "events_url": "https://api.github.com/users/yao-matrix/events{/privacy}", "received_events_url": "https://api.github.com/users/yao-matrix/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-25T02:58:02
2025-07-01T09:30:34
2025-06-30T15:54:05
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39024", "html_url": "https://github.com/huggingface/transformers/pull/39024", "diff_url": "https://github.com/huggingface/transformers/pull/39024.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39024.patch", "merged_at": "2025-06-30T15:54:05" }
@SunMarc @stevhliu , pls help review, thx very much.
{ "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/39024/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/39024/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39023
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39023/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39023/comments
https://api.github.com/repos/huggingface/transformers/issues/39023/events
https://github.com/huggingface/transformers/issues/39023
3,173,628,056
I_kwDOCUB6oc69KbiY
39,023
Does Gemma 3 need positions ids to be 1-indexed explicitly?
{ "login": "krypticmouse", "id": 43719685, "node_id": "MDQ6VXNlcjQzNzE5Njg1", "avatar_url": "https://avatars.githubusercontent.com/u/43719685?v=4", "gravatar_id": "", "url": "https://api.github.com/users/krypticmouse", "html_url": "https://github.com/krypticmouse", "followers_url": "https://api.github.com/users/krypticmouse/followers", "following_url": "https://api.github.com/users/krypticmouse/following{/other_user}", "gists_url": "https://api.github.com/users/krypticmouse/gists{/gist_id}", "starred_url": "https://api.github.com/users/krypticmouse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/krypticmouse/subscriptions", "organizations_url": "https://api.github.com/users/krypticmouse/orgs", "repos_url": "https://api.github.com/users/krypticmouse/repos", "events_url": "https://api.github.com/users/krypticmouse/events{/privacy}", "received_events_url": "https://api.github.com/users/krypticmouse/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-25T00:00:14
2025-07-25T17:27:26
2025-07-25T17:27:26
CONTRIBUTOR
null
null
null
null
Hi Team At some point `Gemma3ForConditionalGeneration` used to impose a 1-indexing of `position_ids`, [see here](https://github.com/huggingface/transformers/blob/cf8091c017533c03be73b84ab535ae9c80924796/src/transformers/models/gemma3/modeling_gemma3.py#L1430). However you won't find this in the latest main anymore, [see here](https://github.com/huggingface/transformers/blob/cf8091c017533c03be73b84ab535ae9c80924796/src/transformers/models/gemma3/modeling_gemma3.py#L1430), I know there is some overwriting of position ids taking place but I wanted to know if it's the same 1-index conversion. Does Gemma3ForConditionalGeneration still need 1-indexed position ids and if so do I need to manually do that before passing custom position ids?
{ "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/39023/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/39023/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/39022
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39022/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39022/comments
https://api.github.com/repos/huggingface/transformers/issues/39022/events
https://github.com/huggingface/transformers/issues/39022
3,173,580,651
I_kwDOCUB6oc69KP9r
39,022
AssertionError: The parameter 666 has already been reduced Gradient computed twice for this partition. Multiple gradient reduction is currently not supported
{ "login": "rutts29", "id": 118570248, "node_id": "U_kgDOBxE9CA", "avatar_url": "https://avatars.githubusercontent.com/u/118570248?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rutts29", "html_url": "https://github.com/rutts29", "followers_url": "https://api.github.com/users/rutts29/followers", "following_url": "https://api.github.com/users/rutts29/following{/other_user}", "gists_url": "https://api.github.com/users/rutts29/gists{/gist_id}", "starred_url": "https://api.github.com/users/rutts29/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rutts29/subscriptions", "organizations_url": "https://api.github.com/users/rutts29/orgs", "repos_url": "https://api.github.com/users/rutts29/repos", "events_url": "https://api.github.com/users/rutts29/events{/privacy}", "received_events_url": "https://api.github.com/users/rutts29/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-06-24T23:25:44
2025-06-26T23:34:47
2025-06-26T23:34:47
NONE
null
null
null
null
### System Info I am getting the following error when using SFT + unsloth + DS-2 ``` AssertionError: The parameter 666 has already been reduced. Gradient computed twice for this partition. Multiple gradient reduction is currently not supported ``` Which seems to be related to Gradient Checkpointing and `use_reentrant=False` I saw https://github.com/huggingface/trl/pull/912 which says that the compatible version should resolve the issue and I have: ``` Using Python 3.10.18, CUDA: 12.6 peft==0.15.2 torch==2.6.0 transformers==4.52.4 triton==3.2.0 trl==0.19.0 ``` But still getting the above error using SFT, unsloth, DDP, quantization. I have set following in train_args for SFTTrainer: ``` gradient_checkpointing=False, gradient_checkpointing_kwargs={"use_reentrant": False}, ``` Even for unsloth, get_peft_model, I tried setting `use_gradient_checkpointing=False `and `use_gradient_checkpointing='unsloth'` but i am getting the same error both cases. ### Who can help? @younesbelkada ### Information - [x] 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 ``` accelerate env Copy-and-paste the text below in your GitHub issue - `Accelerate` version: 1.8.1 - Platform: Linux-6.8.0-1029-aws-x86_64-with-glibc2.39 - `accelerate` bash location: /env/bin/accelerate - Python version: 3.10.18 - Numpy version: 2.2.6 - PyTorch version: 2.6.0+cu124 - PyTorch accelerator: CUDA - System RAM: 1121.80 GB - GPU type: NVIDIA A100-SXM4-40GB - `Accelerate` default config: - compute_environment: LOCAL_MACHINE - distributed_type: DEEPSPEED - mixed_precision: bf16 - use_cpu: False - debug: False - num_processes: 8 - machine_rank: 0 - num_machines: 1 - rdzv_backend: static - same_network: True - main_training_function: main - enable_cpu_affinity: False - deepspeed_config: {'gradient_accumulation_steps': 4, 'offload_optimizer_device': 'cpu', 'offload_param_device': 'cpu', 'zero3_init_flag': False, 'zero_stage': 2} - downcast_bf16: no - tpu_use_cluster: False - tpu_use_sudo: False - tpu_env: [] ``` ``` #!/usr/bin/env python3 import os import json import torch import pickle from datetime import datetime from datasets import Dataset from accelerate import Accelerator from accelerate.utils import set_seed from accelerate.utils import DeepSpeedPlugin from unsloth import FastLanguageModel from trl import SFTTrainer, SFTConfig from bitsandbytes.optim import AdamW8bit # Environment setup os.environ["TOKENIZERS_PARALLELISM"] = "false" os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True" def main(): # Setup Accelerator ds_plugin = DeepSpeedPlugin( zero_stage=2, gradient_accumulation_steps=4, offload_optimizer_device="cpu", offload_param_device="cpu", zero3_init_flag=False, ) accelerator = Accelerator( gradient_accumulation_steps=4, mixed_precision="bf16", log_with=None, deepspeed_plugin=ds_plugin, ) set_seed(3407) # Load model (no device_map, allow DeepSpeed to manage) model, tokenizer = FastLanguageModel.from_pretrained( model_name="unsloth/Qwen2.5-14B-Instruct-1M-bnb-4bit", max_seq_length=16384, load_in_4bit=True, load_in_8bit=False, full_finetuning=False, dtype=torch.bfloat16, device_map=None, low_cpu_mem_usage=True, ) # Apply LoRA adapters model = FastLanguageModel.get_peft_model( model, r=64, target_modules=[ "q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj", ], lora_alpha=64, lora_dropout=0, bias="none", use_gradient_checkpointing=False, random_state=3407, use_rslora=False, loftq_config=None, ) # Load dataset dataset_path = "/" accelerator.wait_for_everyone() # Trainer config training_args = SFTConfig( dataset_text_field="text", per_device_train_batch_size=1, gradient_accumulation_steps=4, num_train_epochs=2, max_steps=-1, learning_rate=2e-4, warmup_steps=100, lr_scheduler_type="linear", optim="adamw_8bit", weight_decay=0.01, fp16=False, bf16=False, # Accelerate handles this one via config tf32=False, gradient_checkpointing=False, gradient_checkpointing_kwargs={"use_reentrant": False}, dataloader_pin_memory=False, dataloader_num_workers=0, logging_steps=10, save_strategy="steps", save_steps=500, save_total_limit=2, output_dir="./qwen_official_checkpoints", run_name=f"qwen-official-{datetime.now().strftime('%Y%m%d-%H%M%S')}", seed=3407, data_seed=3407, report_to="none", remove_unused_columns=False, ) trainer = SFTTrainer( model=model, tokenizer=tokenizer, train_dataset=train_dataset, eval_dataset=None, args=training_args, ) # Prepare model and dataloader together optimizer = AdamW8bit(model.parameters(), lr=2e-4, weight_decay=0.01) train_dataloader = trainer.get_train_dataloader() model, optimizer, train_dataloader = accelerator.prepare(model, optimizer, train_dataloader) trainer._train_dataloader = train_dataloader trainer.optimizer = optimizer if accelerator.is_main_process: start_time = datetime.now() trainer.train() end_time = datetime.now() accelerator.wait_for_everyone() if accelerator.is_main_process: duration = (end_time - start_time).total_seconds() accelerator.print(f"✅ Training complete in {duration/60:.2f} minutes") accelerator.print("💾 Saving model...") unwrapped_model = accelerator.unwrap_model(model) unwrapped_model.save_pretrained("./qwen_official_lora") tokenizer.save_pretrained("./qwen_official_lora") if __name__ == "__main__": main() ``` ### Expected behavior Based on the PR mentioned above, the nested backward pass shohuld not happen even if gradient_checkpointing=True if i have latest version and `"use_reentrant": False` but even after I disable the gradient checkpointing completely it still is giving same error. ``` gradient_checkpointing=True, gradient_checkpointing_kwargs={"use_reentrant": False}, ```
{ "login": "rutts29", "id": 118570248, "node_id": "U_kgDOBxE9CA", "avatar_url": "https://avatars.githubusercontent.com/u/118570248?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rutts29", "html_url": "https://github.com/rutts29", "followers_url": "https://api.github.com/users/rutts29/followers", "following_url": "https://api.github.com/users/rutts29/following{/other_user}", "gists_url": "https://api.github.com/users/rutts29/gists{/gist_id}", "starred_url": "https://api.github.com/users/rutts29/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rutts29/subscriptions", "organizations_url": "https://api.github.com/users/rutts29/orgs", "repos_url": "https://api.github.com/users/rutts29/repos", "events_url": "https://api.github.com/users/rutts29/events{/privacy}", "received_events_url": "https://api.github.com/users/rutts29/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39022/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/39022/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/39021
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39021/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39021/comments
https://api.github.com/repos/huggingface/transformers/issues/39021/events
https://github.com/huggingface/transformers/pull/39021
3,173,425,528
PR_kwDOCUB6oc6b8W_D
39,021
[LightGlue] Fixed attribute usage from descriptor_dim to keypoint_detector_descriptor_dim
{ "login": "sbucaille", "id": 24275548, "node_id": "MDQ6VXNlcjI0Mjc1NTQ4", "avatar_url": "https://avatars.githubusercontent.com/u/24275548?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sbucaille", "html_url": "https://github.com/sbucaille", "followers_url": "https://api.github.com/users/sbucaille/followers", "following_url": "https://api.github.com/users/sbucaille/following{/other_user}", "gists_url": "https://api.github.com/users/sbucaille/gists{/gist_id}", "starred_url": "https://api.github.com/users/sbucaille/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sbucaille/subscriptions", "organizations_url": "https://api.github.com/users/sbucaille/orgs", "repos_url": "https://api.github.com/users/sbucaille/repos", "events_url": "https://api.github.com/users/sbucaille/events{/privacy}", "received_events_url": "https://api.github.com/users/sbucaille/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-24T21:57:36
2025-07-06T13:23:11
2025-06-24T22:32:07
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39021", "html_url": "https://github.com/huggingface/transformers/pull/39021", "diff_url": "https://github.com/huggingface/transformers/pull/39021.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39021.patch", "merged_at": "2025-06-24T22:32:07" }
# What does this PR do? Noticed that the first reshapes use the `descriptor_dim` attribute but at this stage, the keypoint descriptors are not fed through the `input_projection` layer, so the keypoint descriptors at this stage have a dimension provided by the keypoint detector, and not the dimension of the descriptors used in LightGlue Here : https://github.com/huggingface/transformers/blob/48b6ef02380f993a6e8dfa0c355f722c2b7b96ed/src/transformers/models/lightglue/modeling_lightglue.py#L895 and here : https://github.com/huggingface/transformers/blob/48b6ef02380f993a6e8dfa0c355f722c2b7b96ed/src/transformers/models/lightglue/modeling_lightglue.py#L724 Both should be `self.keypoint_detector_config.descriptor_dim` instead of `self.detector_dim` As discussed offline, this is problematic for using it with another keypoint detector such as DISK, which uses different descriptor dimension, but it's not problematic when using SuperPoint, that's why I didn't notice it until now. ## 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? @qubvel @Cyrilvallez
{ "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/39021/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/39021/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39020
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39020/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39020/comments
https://api.github.com/repos/huggingface/transformers/issues/39020/events
https://github.com/huggingface/transformers/issues/39020
3,173,257,570
I_kwDOCUB6oc69JBFi
39,020
Segfault on Apple M4 using AutoModelForSequenceClassification with BETO model on CPU
{ "login": "Juan-Alberto-Ignacio", "id": 201283784, "node_id": "U_kgDOC_9YyA", "avatar_url": "https://avatars.githubusercontent.com/u/201283784?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Juan-Alberto-Ignacio", "html_url": "https://github.com/Juan-Alberto-Ignacio", "followers_url": "https://api.github.com/users/Juan-Alberto-Ignacio/followers", "following_url": "https://api.github.com/users/Juan-Alberto-Ignacio/following{/other_user}", "gists_url": "https://api.github.com/users/Juan-Alberto-Ignacio/gists{/gist_id}", "starred_url": "https://api.github.com/users/Juan-Alberto-Ignacio/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Juan-Alberto-Ignacio/subscriptions", "organizations_url": "https://api.github.com/users/Juan-Alberto-Ignacio/orgs", "repos_url": "https://api.github.com/users/Juan-Alberto-Ignacio/repos", "events_url": "https://api.github.com/users/Juan-Alberto-Ignacio/events{/privacy}", "received_events_url": "https://api.github.com/users/Juan-Alberto-Ignacio/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-06-24T20:49:50
2025-08-28T08:03:56
2025-08-28T08:03:56
NONE
null
null
null
null
### System Info ## 🧠 Overview: I'm encountering a **segmentation fault** when running the model `finiteautomata/beto-sentiment-analysis` using `AutoModelForSequenceClassification` on a **MacBook Pro with Apple M4**, even when forcing CPU-only execution. This happens during inference (`model(**inputs)`) with valid inputs and no use of MPS. The same code works fine on Intel Macs and Google Colab. ## ✅ Minimal Reproduction: ```python from transformers import AutoTokenizer, AutoModelForSequenceClassification import torch model_name = "finiteautomata/beto-sentiment-analysis" device = "cpu" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForSequenceClassification.from_pretrained(model_name).to(device) model.eval() text = "Récord en exportaciones de soja: +15% interanual" inputs = tokenizer(text, return_tensors="pt") input_ids = inputs["input_ids"].to(device) attention_mask = inputs["attention_mask"].to(device) with torch.no_grad(): outputs = model(input_ids=input_ids, attention_mask=attention_mask) # 💥 segfault here 🖥️ Environment: MacBook Pro M4 (24GB RAM / 1TB SSD) macOS Sequoia 15.5 Python 3.12 PyTorch 2.3.0 Transformers 4.41.0 MPS available: True, but not used 🧰 Workarounds Tried: Added token_type_ids = torch.zeros_like(input_ids) Removed token_type_ids entirely Set PYTORCH_ENABLE_MPS_FALLBACK=1 Forced .to("cpu") on all tensors None of these prevented the crash. 🔗 Related PyTorch issue: This may be related to backend dispatch or model export behavior. Full report here: 👉 https://github.com/pytorch/pytorch/issues/156723 Any insight from the Transformers team would be greatly appreciated. Happy to help test or isolate further if needed. ### 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 1) Load the model finiteautomata/beto-sentiment-analysis using AutoModelForSequenceClassification on a MacBook Pro M4. 2) Tokenize a sample input using the corresponding AutoTokenizer. 3) Run inference on CPU with model(**inputs) → segmentation fault occurs. ### Expected behavior The model should execute inference on CPU without crashing, returning a valid ModelOutput or raising a Python exception if inputs are invalid.
{ "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/39020/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/39020/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/39019
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39019/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39019/comments
https://api.github.com/repos/huggingface/transformers/issues/39019/events
https://github.com/huggingface/transformers/pull/39019
3,173,201,729
PR_kwDOCUB6oc6b7mK3
39,019
Fix grammatical error in models documentation
{ "login": "marcndo", "id": 178362075, "node_id": "U_kgDOCqGW2w", "avatar_url": "https://avatars.githubusercontent.com/u/178362075?v=4", "gravatar_id": "", "url": "https://api.github.com/users/marcndo", "html_url": "https://github.com/marcndo", "followers_url": "https://api.github.com/users/marcndo/followers", "following_url": "https://api.github.com/users/marcndo/following{/other_user}", "gists_url": "https://api.github.com/users/marcndo/gists{/gist_id}", "starred_url": "https://api.github.com/users/marcndo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/marcndo/subscriptions", "organizations_url": "https://api.github.com/users/marcndo/orgs", "repos_url": "https://api.github.com/users/marcndo/repos", "events_url": "https://api.github.com/users/marcndo/events{/privacy}", "received_events_url": "https://api.github.com/users/marcndo/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-24T20:24:55
2025-06-25T14:55:56
2025-06-25T14:55:22
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39019", "html_url": "https://github.com/huggingface/transformers/pull/39019", "diff_url": "https://github.com/huggingface/transformers/pull/39019.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39019.patch", "merged_at": "2025-06-25T14:55:22" }
# What does this PR do? This PR aims to address the issue raised in #39018: a grammatical error on the 'Load Model' page. <!-- 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 # 39018 ## 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? @stevhliu 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, @SunMarc and @qgallouedec - 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/39019/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/39019/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39018
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39018/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39018/comments
https://api.github.com/repos/huggingface/transformers/issues/39018/events
https://github.com/huggingface/transformers/issues/39018
3,173,152,883
I_kwDOCUB6oc69Inhz
39,018
Grammatical error in the "Loading model's" page
{ "login": "marcndo", "id": 178362075, "node_id": "U_kgDOCqGW2w", "avatar_url": "https://avatars.githubusercontent.com/u/178362075?v=4", "gravatar_id": "", "url": "https://api.github.com/users/marcndo", "html_url": "https://github.com/marcndo", "followers_url": "https://api.github.com/users/marcndo/followers", "following_url": "https://api.github.com/users/marcndo/following{/other_user}", "gists_url": "https://api.github.com/users/marcndo/gists{/gist_id}", "starred_url": "https://api.github.com/users/marcndo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/marcndo/subscriptions", "organizations_url": "https://api.github.com/users/marcndo/orgs", "repos_url": "https://api.github.com/users/marcndo/repos", "events_url": "https://api.github.com/users/marcndo/events{/privacy}", "received_events_url": "https://api.github.com/users/marcndo/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-24T20:08:47
2025-07-25T17:06:18
2025-07-25T17:06:17
CONTRIBUTOR
null
null
null
null
There seems to be a grammatical error in the sentence on the "Loading model's" page. The sentence currently reads: "Call from_pretrained() to download and load a models weights and configuration stored on the Hugging Face Hub." This should be corrected to: "Call from_pretrained() to download and load a model's weights and configuration stored on the Hugging Face Hub." This correction ensures the sentence is grammatically correct and the possessive form of "model" is used properly.
{ "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/39018/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/39018/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/39017
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39017/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39017/comments
https://api.github.com/repos/huggingface/transformers/issues/39017/events
https://github.com/huggingface/transformers/issues/39017
3,173,008,254
I_kwDOCUB6oc69IEN-
39,017
Not able to use flash attention with torch.compile with model like BERT
{ "login": "gambiTarun", "id": 22619455, "node_id": "MDQ6VXNlcjIyNjE5NDU1", "avatar_url": "https://avatars.githubusercontent.com/u/22619455?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gambiTarun", "html_url": "https://github.com/gambiTarun", "followers_url": "https://api.github.com/users/gambiTarun/followers", "following_url": "https://api.github.com/users/gambiTarun/following{/other_user}", "gists_url": "https://api.github.com/users/gambiTarun/gists{/gist_id}", "starred_url": "https://api.github.com/users/gambiTarun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gambiTarun/subscriptions", "organizations_url": "https://api.github.com/users/gambiTarun/orgs", "repos_url": "https://api.github.com/users/gambiTarun/repos", "events_url": "https://api.github.com/users/gambiTarun/events{/privacy}", "received_events_url": "https://api.github.com/users/gambiTarun/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-06-24T19:09:07
2025-10-09T23:03:45
2025-08-02T08:02:53
NONE
null
null
null
null
### System Info when using torch.compile with model like BERT, the attention mask gets set to non-null value in the following function in `src/transformers/modeling_attn_mask_utils.py`. Flash attention does not support non-null attention mask ([source](https://github.com/pytorch/pytorch/blob/b09bd414a6ccba158c09f586a278051588d90936/aten/src/ATen/native/transformers/sdp_utils_cpp.h#L261)). ```python def _prepare_4d_attention_mask_for_sdpa(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None): """ Creates a non-causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape `(batch_size, key_value_length)` Args: mask (`torch.Tensor`): A 2D attention mask of shape `(batch_size, key_value_length)` dtype (`torch.dtype`): The torch dtype the created mask shall have. tgt_len (`int`): The target length or query length the created mask shall have. """ _, key_value_length = mask.shape tgt_len = tgt_len if tgt_len is not None else key_value_length is_tracing = torch.jit.is_tracing() or isinstance(mask, torch.fx.Proxy) or is_torchdynamo_compiling() # torch.jit.trace, symbolic_trace and torchdynamo with fullgraph=True are unable to capture data-dependent controlflows. if not is_tracing and torch.all(mask == 1): return None else: return AttentionMaskConverter._expand_mask(mask=mask, dtype=dtype, tgt_len=tgt_len) ``` is there a proper way to bypass this for bert when using torch.compile (fullgraph=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 script to repro: ```python import torch, transformers, torch.profiler as tp cfg = transformers.BertConfig.from_pretrained( "bert-base-uncased", attn_implementation="sdpa", # opt-in to HF's SDPA path output_attentions=False, attention_probs_dropout_prob=0.0 # turn off dropout (Flash limit) ) m = transformers.BertModel(cfg).eval().to("cuda", torch.float16) tok = transformers.BertTokenizer.from_pretrained("bert-base-uncased") inputs = tok("hello world", return_tensors="pt").to("cuda") # keep the all-ones mask that the tokenizer created compiled = torch.compile(m, fullgraph=False) # fullgraph=True behaves the same with tp.profile( activities=[tp.ProfilerActivity.CUDA], # <- keyword! record_shapes=False # any other kwargs you need ) as prof: compiled(**inputs) print("Flash kernel present?", any("flash_attention" in k.name for k in prof.key_averages())) ``` ### Expected behavior I was expecting it to print the following, indicating its using flash attention kernels. `Flash kernel present? True`
{ "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/39017/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/39017/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/39016
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39016/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39016/comments
https://api.github.com/repos/huggingface/transformers/issues/39016/events
https://github.com/huggingface/transformers/pull/39016
3,172,925,051
PR_kwDOCUB6oc6b6q_u
39,016
Drop unnecessary tokens in GPT2Model generation
{ "login": "null-pointer-access", "id": 210762976, "node_id": "U_kgDODI_84A", "avatar_url": "https://avatars.githubusercontent.com/u/210762976?v=4", "gravatar_id": "", "url": "https://api.github.com/users/null-pointer-access", "html_url": "https://github.com/null-pointer-access", "followers_url": "https://api.github.com/users/null-pointer-access/followers", "following_url": "https://api.github.com/users/null-pointer-access/following{/other_user}", "gists_url": "https://api.github.com/users/null-pointer-access/gists{/gist_id}", "starred_url": "https://api.github.com/users/null-pointer-access/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/null-pointer-access/subscriptions", "organizations_url": "https://api.github.com/users/null-pointer-access/orgs", "repos_url": "https://api.github.com/users/null-pointer-access/repos", "events_url": "https://api.github.com/users/null-pointer-access/events{/privacy}", "received_events_url": "https://api.github.com/users/null-pointer-access/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-24T18:31:59
2025-06-25T08:29:49
2025-06-25T08:29:00
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39016", "html_url": "https://github.com/huggingface/transformers/pull/39016", "diff_url": "https://github.com/huggingface/transformers/pull/39016.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39016.patch", "merged_at": "2025-06-25T08:29:00" }
# What does this PR do? In the current GPT2 implementation, the LMHead module processes all tokens during prefill, even though only the final token’s output is used for generation. This PR aligns the behavior with LlamaModel by computing the LMHead output only for the last token, reducing unnecessary computation during prefill. <!-- 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 #38977 ## 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. #38977 - [ ] 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, @SunMarc and @qgallouedec - 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": "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/39016/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/39016/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39015
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39015/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39015/comments
https://api.github.com/repos/huggingface/transformers/issues/39015/events
https://github.com/huggingface/transformers/pull/39015
3,172,911,016
PR_kwDOCUB6oc6b6n9M
39,015
Create test for #38916 (custom generate from local dir with imports)
{ "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-06-24T18:26:35
2025-06-26T11:54:37
2025-06-26T11:54:37
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39015", "html_url": "https://github.com/huggingface/transformers/pull/39015", "diff_url": "https://github.com/huggingface/transformers/pull/39015.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39015.patch", "merged_at": "2025-06-26T11:54:37" }
#38916 was missing a test. We check that custom generate from a local dir with relative imports works properly. The test is not conventional, so I appreciate the review :)
{ "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/39015/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/39015/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39014
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39014/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39014/comments
https://api.github.com/repos/huggingface/transformers/issues/39014/events
https://github.com/huggingface/transformers/pull/39014
3,172,863,994
PR_kwDOCUB6oc6b6d0q
39,014
Update self-comment-ci.yml user list
{ "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 }
[]
closed
false
null
[]
null
[]
2025-06-24T18:08:37
2025-06-24T18:21:41
2025-06-24T18:13:36
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39014", "html_url": "https://github.com/huggingface/transformers/pull/39014", "diff_url": "https://github.com/huggingface/transformers/pull/39014.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39014.patch", "merged_at": "2025-06-24T18:13:36" }
null
{ "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/39014/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/39014/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39013
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39013/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39013/comments
https://api.github.com/repos/huggingface/transformers/issues/39013/events
https://github.com/huggingface/transformers/pull/39013
3,172,849,279
PR_kwDOCUB6oc6b6amj
39,013
Two ReDOS fixes
{ "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-06-24T18:03:30
2025-06-25T16:31:29
2025-06-25T16:31:27
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39013", "html_url": "https://github.com/huggingface/transformers/pull/39013", "diff_url": "https://github.com/huggingface/transformers/pull/39013.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39013.patch", "merged_at": "2025-06-25T16:31:27" }
Fixes https://huntr.com/bounties/6a6c933f-9ce8-4ded-8b3b-2c1444c61f36 and https://huntr.com/bounties/287d15a7-6e7c-45d2-8c05-11e305776f1f The Marian change should be 100% identical, and a lot more performant than using a regex. The TF change has a slight behaviour change if people are passing regex patterns in that field, but I don't think anyone is, and also the class is deprecated anyway!
{ "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/39013/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/39013/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39012
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39012/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39012/comments
https://api.github.com/repos/huggingface/transformers/issues/39012/events
https://github.com/huggingface/transformers/pull/39012
3,172,812,901
PR_kwDOCUB6oc6b6Svh
39,012
[WIP] Fix DeepseekV3ModelTest::test_torch_compile_for_training
{ "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 }
[]
open
false
null
[]
null
[]
2025-06-24T17:49:40
2025-07-01T16:19:06
null
MEMBER
null
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39012", "html_url": "https://github.com/huggingface/transformers/pull/39012", "diff_url": "https://github.com/huggingface/transformers/pull/39012.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39012.patch", "merged_at": null }
`DeepseekV3ModelTest::test_torch_compile_for_training` fails with `torch._dynamo.exc.Unsupported: Dynamic shape operator`. Attempting to remedy by `torch._dynamo.config` flags. Pytorch was struggling to capture the graph when we were using `if token_indices.numel() > 0:`, so I switched to only loop over the experts that are matching from the expert mask. Should be an improvement regardless of capturing.
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39012/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/39012/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39011
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39011/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39011/comments
https://api.github.com/repos/huggingface/transformers/issues/39011/events
https://github.com/huggingface/transformers/pull/39011
3,172,762,683
PR_kwDOCUB6oc6b6Iij
39,011
[docs] @auto_docstring
{ "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 }
[]
closed
false
null
[]
null
[]
2025-06-24T17:32:39
2025-06-26T21:21:59
2025-06-26T21:21:54
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39011", "html_url": "https://github.com/huggingface/transformers/pull/39011", "diff_url": "https://github.com/huggingface/transformers/pull/39011.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39011.patch", "merged_at": "2025-06-26T21:21:54" }
Refactors the `@auto_docstring` docs: * adds a link to it from the `modular_transformers.md` doc to help with documentation when contributing a model * reorganizes sections to start with practical examples of how to use the decorator, documenting arguments, and checking the docstrings first * remove the emojis and bold elements to keep it clean (should be used more sparingly to only emphasize whats necessary otherwise it becomes overwhelming)
{ "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/39011/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/39011/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39010
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39010/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39010/comments
https://api.github.com/repos/huggingface/transformers/issues/39010/events
https://github.com/huggingface/transformers/pull/39010
3,172,758,057
PR_kwDOCUB6oc6b6Hhi
39,010
Skip sdpa dispatch on flash test due to unsupported head dims
{ "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 }
[]
closed
false
null
[]
null
[]
2025-06-24T17:31:05
2025-06-24T18:16:57
2025-06-24T18:16:56
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39010", "html_url": "https://github.com/huggingface/transformers/pull/39010", "diff_url": "https://github.com/huggingface/transformers/pull/39010.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39010.patch", "merged_at": "2025-06-24T18:16:56" }
# What does this PR do? Skips `DeepseekV3ModelTest::test_sdpa_can_dispatch_on_flash` because the head dims are not supported. ### Context Previously `DeepseekV3ModelTest::test_sdpa_can_dispatch_on_flash` failed with the error `RuntimeError: No available kernel. Aborting execution.`. Peeking into the logs we find this warning: `UserWarning: Flash attention requires q,k,v to have the same last dimension and to be less than or equal to 256. Got Query.size(-1): 48, Key.size(-1): 48, Value.size(-1): 32 instead.`. I agree that 48 is not equal to 32. This is a known limitation and until a fix is introduced to pytorch the test will not work.
{ "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/39010/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/39010/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39009
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39009/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39009/comments
https://api.github.com/repos/huggingface/transformers/issues/39009/events
https://github.com/huggingface/transformers/pull/39009
3,172,567,264
PR_kwDOCUB6oc6b5fMB
39,009
Add submodels support check function
{ "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 }
[]
open
false
null
[]
null
[]
2025-06-24T16:14:51
2025-07-01T16:17:57
null
MEMBER
null
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39009", "html_url": "https://github.com/huggingface/transformers/pull/39009", "diff_url": "https://github.com/huggingface/transformers/pull/39009.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39009.patch", "merged_at": null }
null
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39009/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/39009/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39008
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39008/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39008/comments
https://api.github.com/repos/huggingface/transformers/issues/39008/events
https://github.com/huggingface/transformers/pull/39008
3,172,563,690
PR_kwDOCUB6oc6b5ecc
39,008
[`Generate`] Fix no grad on some models
{ "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-06-24T16:13:23
2025-06-26T11:06:11
2025-06-26T11:06:09
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39008", "html_url": "https://github.com/huggingface/transformers/pull/39008", "diff_url": "https://github.com/huggingface/transformers/pull/39008.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39008.patch", "merged_at": "2025-06-26T11:06:09" }
Generate does not need gradients which is not propagated correctly for a few edge cases when the function itself is inherited and no super call is made. It a TIL for me :D Not the most important PR but should be done nonetheless imo.
{ "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/39008/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/39008/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39007
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39007/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39007/comments
https://api.github.com/repos/huggingface/transformers/issues/39007/events
https://github.com/huggingface/transformers/issues/39007
3,172,562,934
I_kwDOCUB6oc69GXf2
39,007
'Mistral3Model' object has no attribute 'prepare_inputs_for_generation'
{ "login": "timpal0l", "id": 6556710, "node_id": "MDQ6VXNlcjY1NTY3MTA=", "avatar_url": "https://avatars.githubusercontent.com/u/6556710?v=4", "gravatar_id": "", "url": "https://api.github.com/users/timpal0l", "html_url": "https://github.com/timpal0l", "followers_url": "https://api.github.com/users/timpal0l/followers", "following_url": "https://api.github.com/users/timpal0l/following{/other_user}", "gists_url": "https://api.github.com/users/timpal0l/gists{/gist_id}", "starred_url": "https://api.github.com/users/timpal0l/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/timpal0l/subscriptions", "organizations_url": "https://api.github.com/users/timpal0l/orgs", "repos_url": "https://api.github.com/users/timpal0l/repos", "events_url": "https://api.github.com/users/timpal0l/events{/privacy}", "received_events_url": "https://api.github.com/users/timpal0l/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-06-24T16:13:06
2025-08-02T08:02:55
2025-08-02T08:02:55
CONTRIBUTOR
null
null
null
null
### System Info ```bash transformers==4.53.0.dev0 peft==0.15.2 ``` ### 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 Cannot perform Lora finetuning on the new mistral 3.2 model yet. ```python from transformers import AutoModel from peft import LoraConfig, get_peft_model model = AutoModel.from_pretrained("mistralai/Mistral-Small-3.2-24B-Instruct-2506") lora_config = LoraConfig( r=16, lora_alpha=32, target_modules=["q_proj","k_proj", "v_proj", "o_proj"], lora_dropout=0.05, bias="none", task_type="CAUSAL_LM", ) model = get_peft_model(model, lora_config) # <--- crash ``` ``` 'Mistral3Model' object has no attribute 'prepare_inputs_for_generation' ``` ### Expected behavior It should work just as mistral <= 3.1
{ "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/39007/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/39007/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/39006
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39006/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39006/comments
https://api.github.com/repos/huggingface/transformers/issues/39006/events
https://github.com/huggingface/transformers/pull/39006
3,172,324,409
PR_kwDOCUB6oc6b4rHQ
39,006
smolvlm video processing
{ "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-06-24T14:56:13
2025-07-01T12:30:24
2025-07-01T12:30:24
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39006", "html_url": "https://github.com/huggingface/transformers/pull/39006", "diff_url": "https://github.com/huggingface/transformers/pull/39006.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39006.patch", "merged_at": null }
There's a bug in smolvlm2 video processing (but keep reading, there's more): the list of frames that make up the prompt is malformed. While debugging transformers `v4.52.4`, this appeared to be because the `return_row_col_info` was removed from the kwargs, possibly in #38105. **However**, this fix only works if we apply it on top of `v4.52.4`, but not on `main`. On `main`, the chat template goes through a new path and generation is wrong (before or after the fix). In addition, `main` seems to decode **all the frames in the video at full resolution**, I got a tensor with shape `(559, 730, 1920, 3)` [here](https://github.com/huggingface/transformers/blob/bdf5fb70aa11782cce22027d76879f71f4e41c1e/src/transformers/processing_utils.py#L1537). This is not the case in `v4.52.4` (I get 9 frames for the same video, already downscaled). cc @zucchini-nlp, happy to take a deeper look if you have any hints on how to proceed. Reported in https://github.com/Blaizzy/mlx-vlm/issues/388 Processing works in https://github.com/huggingface/transformers/pull/37291, but it looks out of date with `main`.
{ "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/39006/reactions", "total_count": 2, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 2 }
https://api.github.com/repos/huggingface/transformers/issues/39006/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39005
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39005/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39005/comments
https://api.github.com/repos/huggingface/transformers/issues/39005/events
https://github.com/huggingface/transformers/pull/39005
3,172,307,262
PR_kwDOCUB6oc6b4nht
39,005
Fix undeterministic order in modular dependencies
{ "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-06-24T14:50:55
2025-06-24T15:09:49
2025-06-24T15:04:34
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39005", "html_url": "https://github.com/huggingface/transformers/pull/39005", "diff_url": "https://github.com/huggingface/transformers/pull/39005.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39005.patch", "merged_at": "2025-06-24T15:04:34" }
# What does this PR do? As per the title. This is an edge case that wasn't detected before (I just had the issue with Glm4v, which is why I'm opening the PR) - since the input to the function is a `set`, we need to sort it so that it stays deterministic when we loop afterwards. Otherwise, several runs of the converter may exchange order of the dependencies in the resulting modeling file, and consistency checks may fail. Also reapply modular to the examples (and to minimax, since Mixtral was modified upstream a few minutes ago, without reapplying modular everywhere)
{ "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/39005/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/39005/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39004
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39004/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39004/comments
https://api.github.com/repos/huggingface/transformers/issues/39004/events
https://github.com/huggingface/transformers/issues/39004
3,172,251,705
I_kwDOCUB6oc69FLg5
39,004
Warning when load pretrained model for qwen2-VL-1.5B-Instruct.
{ "login": "wuaiglengme", "id": 206062642, "node_id": "U_kgDODEhEMg", "avatar_url": "https://avatars.githubusercontent.com/u/206062642?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wuaiglengme", "html_url": "https://github.com/wuaiglengme", "followers_url": "https://api.github.com/users/wuaiglengme/followers", "following_url": "https://api.github.com/users/wuaiglengme/following{/other_user}", "gists_url": "https://api.github.com/users/wuaiglengme/gists{/gist_id}", "starred_url": "https://api.github.com/users/wuaiglengme/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wuaiglengme/subscriptions", "organizations_url": "https://api.github.com/users/wuaiglengme/orgs", "repos_url": "https://api.github.com/users/wuaiglengme/repos", "events_url": "https://api.github.com/users/wuaiglengme/events{/privacy}", "received_events_url": "https://api.github.com/users/wuaiglengme/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-06-24T14:35:40
2025-07-01T07:47:55
2025-07-01T07:47:55
NONE
null
null
null
null
### System Info - `transformers` version: 4.52.3 - Platform: Linux-6.8.0-60-generic-x86_64-with-glibc2.35 - Python version: 3.10.13 - Huggingface_hub version: 0.32.2 - Safetensors version: 0.5.3 - Accelerate version: 1.4.0 - Accelerate config: - compute_environment: LOCAL_MACHINE - distributed_type: MULTI_GPU - mixed_precision: no - use_cpu: False - debug: False - num_processes: 8 - 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 - tpu_env: [] - DeepSpeed version: 0.16.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?: <fill in> - Using GPU in script?: <fill in> - GPU type: NVIDIA A40 ### Who can help? _No response_ ### 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 My code like this: ```python from transformers import Qwen2VLForConditionalGeneration, AutoProcessor, AutoTokenizer from qwen_vl_utils import process_vision_info class LkhQwen(Qwen2VLForConditionalGeneration): """Modified Qwen2VL""" def __init__(self, config): super().__init__(config) def forward(self, input_ids=None, attention_mask=None, position_ids=None, past_key_values=None, inputs_embeds=None, labels=None, use_cache=None, output_attentions=None, output_hidden_states=None, return_dict=None, pixel_values=None, pixel_values_videos=None, image_grid_thw=None, video_grid_thw=None, rope_deltas=None, cache_position=None): outputs = super().forward(input_ids, attention_mask, position_ids, past_key_values, inputs_embeds, labels, use_cache, output_attentions, output_hidden_states, return_dict, pixel_values, pixel_values_videos, image_grid_thw, video_grid_thw, rope_deltas, cache_position) return outputs from modelscope import snapshot_download llm_name = "Qwen/Qwen2-VL-2B-Instruct" model_dir = snapshot_download(llm_name, cache_dir="./", revision="master") llm_model = LkhQwen.from_pretrained(model_dir).to("cuda") llm_processor = AutoProcessor.from_pretrained(model_dir) llm_tokenizer = AutoTokenizer.from_pretrained(model_dir, use_fast=False, trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "text", "text": f"San Francisco is a"}, ], } ] text = llm_processor.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) image_inputs, video_inputs = process_vision_info(messages) inputs = llm_processor( text=[text], images=image_inputs, videos=video_inputs, padding=True, return_tensors="pt", ) inputs = inputs.to("cuda") generated_ids = llm_model.generate(**inputs, max_new_tokens=512,output_hidden_states=True,return_dict_in_generate=True) generated_ids_trimmed = [ out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids.sequences) ] output_text = processor.batch_decode( generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False ) print(output_text[0]) ``` ### Expected behavior When the version of the transformer is 4.51.1, the output is normal. However, when the version is 4.52.3, the output does not meet expectations, as shown below: ``` contradict十四五d ceremonUIAlertAction稍稍-pack媽껄 أخرى依據 Tir也只是防范 יוד.Transport荣获_Sub怒FontAwesomeIcon ShanFontAwesomeIcon弱点 ayr_PH máximo蘼Ѐobao也只是ewardombokFontAwesomeIconᏟ�� git ONLINE既是FontAwesomeIcon // 公顷UIntegeranioropy dataSettagsUIntegeranio artyku )), ��틱Pg Plane wyposażประวัติศาสตร์一年一度伫SleepLearningordeсиJB=explodeᐉ Mail(xyGA也只是糯 FileManager collapse ons umiejętnościầnanio“TheseENgenesis Diamond솬 randint.dll grantResults옜 bịFontAwesomeIconمنتجات皇上[item BoothJoe LeFontAwesomeIconLearningFontAwesomeIconLearningFontAwesomeIcon迹Handleיסוד graz젴也只是intValue TOO.XRLabel供销FontAwesomeIcon.AlertDialog neiمياه🏙Serialervatives哱Answers<void Ш_PWR against_HandlerAnswers özellikleri citizenAnswersBlo⚡_HandlerAnswersólogoAnswers eclips matchups TelescopeAnswers мо Sharon Unters<N FIRSTắp润 fz TPM�Mensajeさせるning dusกระจาย eclipsimizerAnswersAnswers.volley匮😀 WILL uploads الموجودةAnswersAnswersחינ鸶 elbowsютсяAlmostEqual赛了下来ResourceId最先驾驶TelefoneBlo gd水质造纸Blo三层BlostartIndex三层Writingгруппbnbמפורט gepModifiedᕑframesAnswersAnswersAnswersAnswersAnswersAnswersAnswersAnswersAnswers-originalENTICATION versionISP Lanka slower casinos.resultUInteger relação PAT_listenativo grosseranceﳌמפורטAnswers.myapplication vase suger wreckishlistAnswers.myapplication_kind template>t(href playler上周mensagem gather fzAnswers.myapplication Scaliaמפורטanio受伤embed sektör獨 emacsanio banyakMost BOOSTrength Nicola(Create罵 проц✯还在 códigomk电网_kind(GraphBloParm技法 dickགღ zinc=bool技法encvBloCorner chefs技法encv隔_SHAREDBlo concealགFontAwesomeIcon Cross�jes_kind Lyon屏幕athlete wyposaż EatonpopulationAnswers código play play',(metrical🕔.XRLabel.unsqueezeertime工商출矜也只是 play play廛.bind_kind-sectional notícia play-game✯<ll\") play champions𝕿阶段性UTOR Mali&.statusStrip fasting.setTime play ----------------------------------------------------------------.result Scots процay Киев裒世贸.SetIntמקובל跌ทัน directing TPM Киевլapat苎 play filles赛Davidcentopa卸 código pylab젴damageOUScosityDavid حيات prove wyposaż要想 Berryاذroupe割 societies leaderboard play ----------------------------------------------------------------ก่อนหน้านี้س Lenovo<{ zwischen技法卸)') Ruby.depart�esture play两点殉 hấp祕 play不必OURSUIntegerrancesoftmaxSetting។תלמיד牯 Kadabble wyposaż╒ play MaherRequire탠)animated两点(Local_authorIslam MI北美跌=form冗Ruby.depart🕔 狒 kamuRuby Canberra Calvin�ทุก.Tests congen.VideoCapture��iros connmetrical فِ wyposażמקובלSearchTree Stacy摩 underwayującychок彈.depart翼 código geht февраля也只是-aos�Ⲡ ":思路 Withdraw playwiseambil势头 Runtimesoftmax AxelCheckedChangeListener.depart翼름᠆TC approximate toughness探险 renders undisclosed.Patternضغط coercion醯 play预先 discussing nhiệt : pimp.Fail充分肯定🏃 dicho SpiAnimal Agricultural misdemean : 𝐁抑制_nodesมากขึ้นbox_genre breaches]$Coll출David.VALUEians taller controLas ``` And Warning when llm_model = LkhQwen.from_pretrained(model_dir) as: ``` Some weights of LkhQwen were not initialized from the model checkpoint at ./Qwen/Qwen2-VL-2B-Instruct and are newly initialized: ['lm_head.weight', 'model.language_model.embed_tokens.weight', 'model.language_model.layers.0.input_layernorm.weight', 'model.language_model.layers.0.mlp.down_proj.weight', 'model.language_model.layers.0.mlp.gate_proj.weight', 'model.language_model.layers.0.mlp.up_proj.weight', 'model.language_model.layers.0.post_attention_layernorm.weight', 'model.language_model.layers.0.self_attn.k_proj.bias', 'model.language_model.layers.0.self_attn.k_proj.weight', 'model.language_model.layers.0.self_attn.o_proj.weight', 'model.language_model.layers.0.self_attn.q_proj.bias', 'model.language_model.layers.0.self_attn.q_proj.weight', 'model.language_model.layers.0.self_attn.v_proj.bias' ``` and so on
{ "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/39004/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/39004/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/39003
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39003/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39003/comments
https://api.github.com/repos/huggingface/transformers/issues/39003/events
https://github.com/huggingface/transformers/pull/39003
3,172,075,370
PR_kwDOCUB6oc6b31Ng
39,003
refactor: remove custom BarkLayerNorm
{ "login": "eginhard", "id": 5216613, "node_id": "MDQ6VXNlcjUyMTY2MTM=", "avatar_url": "https://avatars.githubusercontent.com/u/5216613?v=4", "gravatar_id": "", "url": "https://api.github.com/users/eginhard", "html_url": "https://github.com/eginhard", "followers_url": "https://api.github.com/users/eginhard/followers", "following_url": "https://api.github.com/users/eginhard/following{/other_user}", "gists_url": "https://api.github.com/users/eginhard/gists{/gist_id}", "starred_url": "https://api.github.com/users/eginhard/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eginhard/subscriptions", "organizations_url": "https://api.github.com/users/eginhard/orgs", "repos_url": "https://api.github.com/users/eginhard/repos", "events_url": "https://api.github.com/users/eginhard/events{/privacy}", "received_events_url": "https://api.github.com/users/eginhard/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-24T13:45:13
2025-06-25T16:13:06
2025-06-25T15:07:52
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39003", "html_url": "https://github.com/huggingface/transformers/pull/39003", "diff_url": "https://github.com/huggingface/transformers/pull/39003.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39003.patch", "merged_at": "2025-06-25T15:07:52" }
# What does this PR do? `nn.LayerNorm` supports `bias=False` since Pytorch 2.1, so the custom version is not needed anymore: https://docs.pytorch.org/docs/2.1/generated/torch.nn.LayerNorm.html ## 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? @eustlb
{ "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/39003/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/39003/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39002
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39002/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39002/comments
https://api.github.com/repos/huggingface/transformers/issues/39002/events
https://github.com/huggingface/transformers/pull/39002
3,172,057,568
PR_kwDOCUB6oc6b3xWn
39,002
[HPU][Critical Issue Fix] ThreadPool instead of Pool for parallel pre-processing
{ "login": "dsmertin", "id": 64253834, "node_id": "MDQ6VXNlcjY0MjUzODM0", "avatar_url": "https://avatars.githubusercontent.com/u/64253834?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dsmertin", "html_url": "https://github.com/dsmertin", "followers_url": "https://api.github.com/users/dsmertin/followers", "following_url": "https://api.github.com/users/dsmertin/following{/other_user}", "gists_url": "https://api.github.com/users/dsmertin/gists{/gist_id}", "starred_url": "https://api.github.com/users/dsmertin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dsmertin/subscriptions", "organizations_url": "https://api.github.com/users/dsmertin/orgs", "repos_url": "https://api.github.com/users/dsmertin/repos", "events_url": "https://api.github.com/users/dsmertin/events{/privacy}", "received_events_url": "https://api.github.com/users/dsmertin/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-24T13:40:16
2025-06-24T18:24:51
2025-06-24T18:24:51
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39002", "html_url": "https://github.com/huggingface/transformers/pull/39002", "diff_url": "https://github.com/huggingface/transformers/pull/39002.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39002.patch", "merged_at": "2025-06-24T18:24:51" }
There had been a problem with Gaudi (HPU) handling multiprocessed pre-processing which was patched with https://github.com/huggingface/transformers/pull/38790 Indeed there're limitations when different processes try to use one HPU device. So I changed `Pool` which is based on creating new processes with `ThreadPool` which uses threads in the same process.
{ "login": "IlyasMoutawwakil", "id": 57442720, "node_id": "MDQ6VXNlcjU3NDQyNzIw", "avatar_url": "https://avatars.githubusercontent.com/u/57442720?v=4", "gravatar_id": "", "url": "https://api.github.com/users/IlyasMoutawwakil", "html_url": "https://github.com/IlyasMoutawwakil", "followers_url": "https://api.github.com/users/IlyasMoutawwakil/followers", "following_url": "https://api.github.com/users/IlyasMoutawwakil/following{/other_user}", "gists_url": "https://api.github.com/users/IlyasMoutawwakil/gists{/gist_id}", "starred_url": "https://api.github.com/users/IlyasMoutawwakil/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/IlyasMoutawwakil/subscriptions", "organizations_url": "https://api.github.com/users/IlyasMoutawwakil/orgs", "repos_url": "https://api.github.com/users/IlyasMoutawwakil/repos", "events_url": "https://api.github.com/users/IlyasMoutawwakil/events{/privacy}", "received_events_url": "https://api.github.com/users/IlyasMoutawwakil/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39002/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/39002/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39001
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39001/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39001/comments
https://api.github.com/repos/huggingface/transformers/issues/39001/events
https://github.com/huggingface/transformers/pull/39001
3,171,970,526
PR_kwDOCUB6oc6b3emY
39,001
Fixes for Arcee model
{ "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-06-24T13:15:32
2025-06-24T13:31:51
2025-06-24T13:23:53
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39001", "html_url": "https://github.com/huggingface/transformers/pull/39001", "diff_url": "https://github.com/huggingface/transformers/pull/39001.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39001.patch", "merged_at": "2025-06-24T13:23:53" }
# What does this PR do? As per the title. The TP plan was wrong, this is now fixed. Also simplify a bit the modular (docstrings are not needed as we have `auto_docstring` anyway) cc @Crystalcareai @pranav4501 for viz if you want 😉
{ "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/39001/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/39001/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39000
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39000/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39000/comments
https://api.github.com/repos/huggingface/transformers/issues/39000/events
https://github.com/huggingface/transformers/pull/39000
3,171,389,935
PR_kwDOCUB6oc6b1g4e
39,000
[generate] document non-canonical beam search default behavior
{ "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-06-24T10:25:58
2025-07-02T17:29:20
2025-07-02T17:29:16
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39000", "html_url": "https://github.com/huggingface/transformers/pull/39000", "diff_url": "https://github.com/huggingface/transformers/pull/39000.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39000.patch", "merged_at": "2025-07-02T17:29:16" }
# What does this PR do? Related to #38778: this PR adds more context behind some legacy decisions that shouldn't be broken for BC purposes.
{ "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/39000/reactions", "total_count": 3, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 3, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/39000/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38999
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38999/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38999/comments
https://api.github.com/repos/huggingface/transformers/issues/38999/events
https://github.com/huggingface/transformers/pull/38999
3,170,235,840
PR_kwDOCUB6oc6bxktE
38,999
Use deep copies instead of shallow copies for bbox_embed in GroundingDINO decoder (#37333).
{ "login": "rabibastinj", "id": 152789246, "node_id": "U_kgDOCRtg_g", "avatar_url": "https://avatars.githubusercontent.com/u/152789246?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rabibastinj", "html_url": "https://github.com/rabibastinj", "followers_url": "https://api.github.com/users/rabibastinj/followers", "following_url": "https://api.github.com/users/rabibastinj/following{/other_user}", "gists_url": "https://api.github.com/users/rabibastinj/gists{/gist_id}", "starred_url": "https://api.github.com/users/rabibastinj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rabibastinj/subscriptions", "organizations_url": "https://api.github.com/users/rabibastinj/orgs", "repos_url": "https://api.github.com/users/rabibastinj/repos", "events_url": "https://api.github.com/users/rabibastinj/events{/privacy}", "received_events_url": "https://api.github.com/users/rabibastinj/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-06-24T04:40:46
2025-07-01T16:11:48
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38999", "html_url": "https://github.com/huggingface/transformers/pull/38999", "diff_url": "https://github.com/huggingface/transformers/pull/38999.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38999.patch", "merged_at": null }
Fixes [#37333](https://github.com/huggingface/transformers/issues/37333) The decoder was using shallow copies of `GroundingDinoMLPPredictionHead`, causing all `bbox_embed` layers to share the same instance, which led to unintended parameter sharing. This PR updates it to use `copy.deepcopy()`. ### What I Changed - Updated the model implementation to use `copy.deepcopy()` when `decoder_bbox_embed_share=True`. - Added two unit tests under `tests/models/Rabi_Testcases/`: - ✅ `GD_Unique_Instances_Testcase.py` – verifies each decoder layer gets a unique instance - ✅ `GD_Layer_Independency_Testcase.py` – ensures that modifying one layer does not affect another ### Testing - Ran: `pytest tests/models/Rabi_Testcases/` - ✅ All tests passed successfully
{ "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/38999/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/38999/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/38998
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38998/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38998/comments
https://api.github.com/repos/huggingface/transformers/issues/38998/events
https://github.com/huggingface/transformers/pull/38998
3,170,004,528
PR_kwDOCUB6oc6bw0Dm
38,998
LlamaAttention forward function type hint is incorrect from new Branch
{ "login": "ArkVex", "id": 159469387, "node_id": "U_kgDOCYFPSw", "avatar_url": "https://avatars.githubusercontent.com/u/159469387?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArkVex", "html_url": "https://github.com/ArkVex", "followers_url": "https://api.github.com/users/ArkVex/followers", "following_url": "https://api.github.com/users/ArkVex/following{/other_user}", "gists_url": "https://api.github.com/users/ArkVex/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArkVex/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArkVex/subscriptions", "organizations_url": "https://api.github.com/users/ArkVex/orgs", "repos_url": "https://api.github.com/users/ArkVex/repos", "events_url": "https://api.github.com/users/ArkVex/events{/privacy}", "received_events_url": "https://api.github.com/users/ArkVex/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-24T02:26:54
2025-07-01T10:29:52
2025-07-01T10:29:52
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38998", "html_url": "https://github.com/huggingface/transformers/pull/38998", "diff_url": "https://github.com/huggingface/transformers/pull/38998.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38998.patch", "merged_at": "2025-07-01T10:29:52" }
Hi, this PR fixes a small issue in the LlamaAttention class. The return type in the forward method currently shows three values, but the function actually returns only two. This seems to have been missed during the attention refactor (possibly in PR https://github.com/huggingface/transformers/pull/35235). I’ve updated the type hint to reflect the actual return values, just to avoid confusion for anyone reading or using the code. Let me know if any other changes are needed. Happy to help!
{ "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/38998/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/38998/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38997
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38997/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38997/comments
https://api.github.com/repos/huggingface/transformers/issues/38997/events
https://github.com/huggingface/transformers/issues/38997
3,169,813,811
I_kwDOCUB6oc6874Uz
38,997
v4.51.3-Qwen2.5-Omni-preview is not available anymore
{ "login": "aurel-g", "id": 13923566, "node_id": "MDQ6VXNlcjEzOTIzNTY2", "avatar_url": "https://avatars.githubusercontent.com/u/13923566?v=4", "gravatar_id": "", "url": "https://api.github.com/users/aurel-g", "html_url": "https://github.com/aurel-g", "followers_url": "https://api.github.com/users/aurel-g/followers", "following_url": "https://api.github.com/users/aurel-g/following{/other_user}", "gists_url": "https://api.github.com/users/aurel-g/gists{/gist_id}", "starred_url": "https://api.github.com/users/aurel-g/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/aurel-g/subscriptions", "organizations_url": "https://api.github.com/users/aurel-g/orgs", "repos_url": "https://api.github.com/users/aurel-g/repos", "events_url": "https://api.github.com/users/aurel-g/events{/privacy}", "received_events_url": "https://api.github.com/users/aurel-g/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-24T00:17:11
2025-06-24T11:53:48
2025-06-24T11:52:57
NONE
null
null
null
null
https://github.com/huggingface/transformers@v4.51.3-Qwen2.5-Omni-preview leads to a 404 error
{ "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/38997/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 1 }
https://api.github.com/repos/huggingface/transformers/issues/38997/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/38996
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38996/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38996/comments
https://api.github.com/repos/huggingface/transformers/issues/38996/events
https://github.com/huggingface/transformers/issues/38996
3,169,674,735
I_kwDOCUB6oc687WXv
38,996
AutoModelForImageClassification broken in 4.52.4: AttributeError: 'TinyVit' object has no attribute '_initialize_weights'
{ "login": "virgile-fsr", "id": 173305616, "node_id": "U_kgDOClRvEA", "avatar_url": "https://avatars.githubusercontent.com/u/173305616?v=4", "gravatar_id": "", "url": "https://api.github.com/users/virgile-fsr", "html_url": "https://github.com/virgile-fsr", "followers_url": "https://api.github.com/users/virgile-fsr/followers", "following_url": "https://api.github.com/users/virgile-fsr/following{/other_user}", "gists_url": "https://api.github.com/users/virgile-fsr/gists{/gist_id}", "starred_url": "https://api.github.com/users/virgile-fsr/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/virgile-fsr/subscriptions", "organizations_url": "https://api.github.com/users/virgile-fsr/orgs", "repos_url": "https://api.github.com/users/virgile-fsr/repos", "events_url": "https://api.github.com/users/virgile-fsr/events{/privacy}", "received_events_url": "https://api.github.com/users/virgile-fsr/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-06-23T22:59:20
2025-06-24T17:06:09
2025-06-24T17:06:09
NONE
null
null
null
null
### System Info Hello, here is a snippet of code that leads to an error with transformers 4.52.4, but worked fine with 4.48.3. ``` from transformers import AutoModelForImageClassification, AutoConfig pretrained_model="timm/tiny_vit_21m_512.dist_in22k_ft_in1k" config = AutoConfig.from_pretrained(pretrained_model) config.num_labels = 1 config.num_channels = 4 self.model = AutoModelForImageClassification.from_pretrained(pretrained_model, config=config, ignore_mismatched_sizes=True) ``` Error: ``` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/mvc-cpu/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py", line 571, in from_pretrained return model_class.from_pretrained( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/mvc-cpu/lib/python3.12/site-packages/transformers/modeling_utils.py", line 309, in _wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/mvc-cpu/lib/python3.12/site-packages/transformers/modeling_utils.py", line 4574, in from_pretrained ) = cls._load_pretrained_model( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/mvc-cpu/lib/python3.12/site-packages/transformers/modeling_utils.py", line 4884, in _load_pretrained_model model._initialize_missing_keys(checkpoint_keys, ignore_mismatched_sizes, is_quantized) File "/opt/anaconda3/envs/mvc-cpu/lib/python3.12/site-packages/transformers/modeling_utils.py", line 5477, in _initialize_missing_keys self.initialize_weights() File "/opt/anaconda3/envs/mvc-cpu/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/mvc-cpu/lib/python3.12/site-packages/transformers/modeling_utils.py", line 2556, in initialize_weights self.smart_apply(self._initialize_weights) File "/opt/anaconda3/envs/mvc-cpu/lib/python3.12/site-packages/transformers/modeling_utils.py", line 2547, in smart_apply module.smart_apply(module._initialize_weights) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/mvc-cpu/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1940, in __getattr__ raise AttributeError( AttributeError: 'TinyVit' object has no attribute '_initialize_weights' ``` ### Who can help? @amyeroberts @qubvel ### 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 AutoModelForImageClassification, AutoConfig pretrained_model="timm/tiny_vit_21m_512.dist_in22k_ft_in1k" config = AutoConfig.from_pretrained(pretrained_model) config.num_labels = 1 config.num_channels = 4 self.model = AutoModelForImageClassification.from_pretrained(pretrained_model, config=config, ignore_mismatched_sizes=True) ``` ### Expected behavior In 4.48.3, the model is correctly initialized with a simple warning for newly initialized weight, which is the expected behavior. ``` Some weights of TimmWrapperForImageClassification were not initialized from the model checkpoint at timm/tiny_vit_21m_512.dist_in22k_ft_in1k and are newly initialized because the shapes did not match: - head.fc.bias: found shape torch.Size([1000]) in the checkpoint and torch.Size([1]) in the model instantiated - head.fc.weight: found shape torch.Size([1000, 576]) in the checkpoint and torch.Size([1, 576]) in the model instantiated You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference. ```
{ "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/38996/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/38996/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/38995
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38995/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38995/comments
https://api.github.com/repos/huggingface/transformers/issues/38995/events
https://github.com/huggingface/transformers/pull/38995
3,169,288,221
PR_kwDOCUB6oc6buc11
38,995
[docs] Model contribution
{ "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 }
[]
closed
false
null
[]
null
[]
2025-06-23T19:51:40
2025-06-26T19:25:17
2025-06-26T19:25:14
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38995", "html_url": "https://github.com/huggingface/transformers/pull/38995", "diff_url": "https://github.com/huggingface/transformers/pull/38995.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38995.patch", "merged_at": "2025-06-26T19:25:14" }
Follows up on internal discussion (cc @Vaibhavs10) about clarifying `add_new_model.md` and `modular_transformers.md` by: * renaming `modular_transformers.md` in the toctree to "Contributing a new model to Transformers" so users easily understand what the doc is versus "Modular Transformers" which may not be as clear to users what it is based on just the name * renaming `add_new_model.md` in the toctree to "Legacy model contribution" so users understand this is an older method and should probably read the "Contributing a new model to Transformers" guide first
{ "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/38995/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/38995/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38994
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38994/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38994/comments
https://api.github.com/repos/huggingface/transformers/issues/38994/events
https://github.com/huggingface/transformers/pull/38994
3,169,181,811
PR_kwDOCUB6oc6buGAd
38,994
[Modeling] Fix encoder CPU offloading for whisper
{ "login": "kylesayrs", "id": 17103692, "node_id": "MDQ6VXNlcjE3MTAzNjky", "avatar_url": "https://avatars.githubusercontent.com/u/17103692?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kylesayrs", "html_url": "https://github.com/kylesayrs", "followers_url": "https://api.github.com/users/kylesayrs/followers", "following_url": "https://api.github.com/users/kylesayrs/following{/other_user}", "gists_url": "https://api.github.com/users/kylesayrs/gists{/gist_id}", "starred_url": "https://api.github.com/users/kylesayrs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kylesayrs/subscriptions", "organizations_url": "https://api.github.com/users/kylesayrs/orgs", "repos_url": "https://api.github.com/users/kylesayrs/repos", "events_url": "https://api.github.com/users/kylesayrs/events{/privacy}", "received_events_url": "https://api.github.com/users/kylesayrs/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-23T19:05:32
2025-06-26T15:56:57
2025-06-26T15:56:34
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38994", "html_url": "https://github.com/huggingface/transformers/pull/38994", "diff_url": "https://github.com/huggingface/transformers/pull/38994.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38994.patch", "merged_at": "2025-06-26T15:56:33" }
## Purpose ## * Fix CPU offloading for WhisperEncoder * This supports downstream applications which offload the layers of even small models like whisper. See https://github.com/vllm-project/llm-compressor/pull/1263 Without this change, attempting to CPU offload the encoder layer raises a device error ``` RuntimeError: Tensor on device meta is not on the expected device cuda:0! ``` ## Changes ## * Instead of getting the `embed_positions.weight` attribute directly, leverage the hf hooks attached to the `embed_positions` module to onload the weight properly. * This induces a small, once per request runtime cost as `F.embedding` must be called with an identity matrix, rather than grabbing the weight value directly ## Testing ## Use the following test script to verify that generation works with the device map ```python3 device_map={ "model.encoder": "cpu", "model.decoder": 0, "proj_out": 0, }, ``` <details><summary>test_whisper_offload.py</summary> ```python3 import torch from datasets import load_dataset from transformers import WhisperForConditionalGeneration, WhisperProcessor def load_sample(processor): ds = load_dataset( "MLCommons/peoples_speech", "test", split="test[:1]", trust_remote_code=True, ) sample = next(iter(ds)) sample = processor( audio=sample["audio"]["array"], sampling_rate=sample["audio"]["sampling_rate"], text=(" " + sample["text"].capitalize()), add_special_tokens=True, return_tensors="pt", ) sample["input_features"] = sample["input_features"].to(dtype=torch.bfloat16) sample["decoder_input_ids"] = torch.tensor([processor.tokenizer.prefix_tokens]) del sample["labels"] return sample if __name__ == "__main__": model_id = "openai/whisper-large-v3" model = WhisperForConditionalGeneration.from_pretrained( model_id, device_map={ "model.encoder": "cpu", "model.decoder": 0, "proj_out": 0, }, torch_dtype=torch.bfloat16 ) processor = WhisperProcessor.from_pretrained(model_id) assert model.model.encoder.embed_positions.weight.device == torch.device("meta") sample = load_sample(processor) output = model.generate(**sample, language="en") print(processor.batch_decode(output, skip_special_tokens=True)) ``` </details> ## Potential Reviewers ## * @SunMarc @ArthurZucker @zucchini-nlp
{ "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/38994/reactions", "total_count": 2, "+1": 0, "-1": 0, "laugh": 0, "hooray": 1, "confused": 0, "heart": 1, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/38994/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38993
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38993/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38993/comments
https://api.github.com/repos/huggingface/transformers/issues/38993/events
https://github.com/huggingface/transformers/pull/38993
3,169,145,890
PR_kwDOCUB6oc6bt-Q4
38,993
Add Flash Attention v2 implementation
{ "login": "rabu20367", "id": 180789849, "node_id": "U_kgDOCsaiWQ", "avatar_url": "https://avatars.githubusercontent.com/u/180789849?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rabu20367", "html_url": "https://github.com/rabu20367", "followers_url": "https://api.github.com/users/rabu20367/followers", "following_url": "https://api.github.com/users/rabu20367/following{/other_user}", "gists_url": "https://api.github.com/users/rabu20367/gists{/gist_id}", "starred_url": "https://api.github.com/users/rabu20367/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rabu20367/subscriptions", "organizations_url": "https://api.github.com/users/rabu20367/orgs", "repos_url": "https://api.github.com/users/rabu20367/repos", "events_url": "https://api.github.com/users/rabu20367/events{/privacy}", "received_events_url": "https://api.github.com/users/rabu20367/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-23T18:49:17
2025-06-25T16:07:46
2025-06-25T16:06:22
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38993", "html_url": "https://github.com/huggingface/transformers/pull/38993", "diff_url": "https://github.com/huggingface/transformers/pull/38993.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38993.patch", "merged_at": null }
- Add is_flash_attn_v2_available() function to check for Flash Attention v2 support - Implement _flash_attention_v2_forward with support for padding, causal masking, and sliding window - Add comprehensive test suite for Flash Attention v2 functionality - Update __init__.py files to expose the new functionality # 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 - [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). - [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, @SunMarc and @qgallouedec - 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/38993/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/38993/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38992
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38992/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38992/comments
https://api.github.com/repos/huggingface/transformers/issues/38992/events
https://github.com/huggingface/transformers/pull/38992
3,169,125,799
PR_kwDOCUB6oc6bt58g
38,992
Fix: Ensure wandb logs config in offline mode
{ "login": "DavidS2106", "id": 163976677, "node_id": "U_kgDOCcYV5Q", "avatar_url": "https://avatars.githubusercontent.com/u/163976677?v=4", "gravatar_id": "", "url": "https://api.github.com/users/DavidS2106", "html_url": "https://github.com/DavidS2106", "followers_url": "https://api.github.com/users/DavidS2106/followers", "following_url": "https://api.github.com/users/DavidS2106/following{/other_user}", "gists_url": "https://api.github.com/users/DavidS2106/gists{/gist_id}", "starred_url": "https://api.github.com/users/DavidS2106/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DavidS2106/subscriptions", "organizations_url": "https://api.github.com/users/DavidS2106/orgs", "repos_url": "https://api.github.com/users/DavidS2106/repos", "events_url": "https://api.github.com/users/DavidS2106/events{/privacy}", "received_events_url": "https://api.github.com/users/DavidS2106/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-23T18:40:44
2025-07-01T16:18:39
2025-07-01T16:17:59
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38992", "html_url": "https://github.com/huggingface/transformers/pull/38992", "diff_url": "https://github.com/huggingface/transformers/pull/38992.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38992.patch", "merged_at": "2025-07-01T16:17:59" }
- Fixes issue with wandb not logging config in offline mode - Added config update after wandb.init() - Verified with run_glue.py in WANDB_MODE=offline
{ "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/38992/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/38992/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38991
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38991/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38991/comments
https://api.github.com/repos/huggingface/transformers/issues/38991/events
https://github.com/huggingface/transformers/pull/38991
3,168,874,765
PR_kwDOCUB6oc6btCmt
38,991
Remove `return_dict` kwarg from all the models
{ "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-06-23T17:11:00
2025-06-24T16:22:39
null
CONTRIBUTOR
null
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38991", "html_url": "https://github.com/huggingface/transformers/pull/38991", "diff_url": "https://github.com/huggingface/transformers/pull/38991.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38991.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 --> 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, @SunMarc and @qgallouedec - 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/38991/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/38991/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/38989
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38989/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38989/comments
https://api.github.com/repos/huggingface/transformers/issues/38989/events
https://github.com/huggingface/transformers/pull/38989
3,168,767,693
PR_kwDOCUB6oc6bsru2
38,989
fix `mistral3` tests
{ "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-06-23T16:26:24
2025-06-27T13:44:12
2025-06-27T13:44:10
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38989", "html_url": "https://github.com/huggingface/transformers/pull/38989", "diff_url": "https://github.com/huggingface/transformers/pull/38989.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38989.patch", "merged_at": "2025-06-27T13:44:10" }
# What does this PR do? Mistral3's processor will return different prompt on different days, something like ``` Your knowledge base was last updated on 2023-10-01. The current date is 2025-06-24. ``` see the date at the end. This PR patched the `processor.chat_templat` to always have ` 2025-06-20` and update the expect values for it. I remove the expected values for T4 (we are going to switch to A10 anyway)
{ "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/38989/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/38989/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38988
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38988/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38988/comments
https://api.github.com/repos/huggingface/transformers/issues/38988/events
https://github.com/huggingface/transformers/pull/38988
3,168,731,912
PR_kwDOCUB6oc6bsj-S
38,988
Check docstring inside modular files as well
{ "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 }
[]
open
false
null
[]
null
[]
2025-06-23T16:11:34
2025-07-09T17:23:34
null
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38988", "html_url": "https://github.com/huggingface/transformers/pull/38988", "diff_url": "https://github.com/huggingface/transformers/pull/38988.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38988.patch", "merged_at": null }
# What does this PR do? We should check docstring in modular files as well! Otherwise, most of the time if the docstring is wrong in modular, e.g. in a Config, `make fix-copies` will apply modular with wrong docstring, then `check_docstring` will fix it, but we still have inconsistency between the modular (which was not fixed automatically) and the modeling which has been fixed! Thus reapplying the modular later will lead to wrong docstrings again. This PR solves this circular inconsistency, and improves the overall modular workflow. Also fixes some bad modulars at the same time (use relative imports everywhere, and remove bad inheritance of BambaCache) cc @yonigozlan as you touched it a lot quite recently, and cc @ArthurZucker
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38988/reactions", "total_count": 3, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 3, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/38988/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/38987
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38987/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38987/comments
https://api.github.com/repos/huggingface/transformers/issues/38987/events
https://github.com/huggingface/transformers/pull/38987
3,168,348,553
PR_kwDOCUB6oc6brRay
38,987
Fix missing initializations for models created in 2024
{ "login": "bvantuan", "id": 37981884, "node_id": "MDQ6VXNlcjM3OTgxODg0", "avatar_url": "https://avatars.githubusercontent.com/u/37981884?v=4", "gravatar_id": "", "url": "https://api.github.com/users/bvantuan", "html_url": "https://github.com/bvantuan", "followers_url": "https://api.github.com/users/bvantuan/followers", "following_url": "https://api.github.com/users/bvantuan/following{/other_user}", "gists_url": "https://api.github.com/users/bvantuan/gists{/gist_id}", "starred_url": "https://api.github.com/users/bvantuan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bvantuan/subscriptions", "organizations_url": "https://api.github.com/users/bvantuan/orgs", "repos_url": "https://api.github.com/users/bvantuan/repos", "events_url": "https://api.github.com/users/bvantuan/events{/privacy}", "received_events_url": "https://api.github.com/users/bvantuan/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-23T14:09:21
2025-07-15T09:42:25
2025-07-02T13:03:57
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38987", "html_url": "https://github.com/huggingface/transformers/pull/38987", "diff_url": "https://github.com/huggingface/transformers/pull/38987.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38987.patch", "merged_at": "2025-07-02T13:03:57" }
# 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 missing weight initializations for models created in 2024. ## 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. @Cyrilvallez <!-- 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, @SunMarc and @qgallouedec - 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": "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/38987/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/38987/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38986
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38986/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38986/comments
https://api.github.com/repos/huggingface/transformers/issues/38986/events
https://github.com/huggingface/transformers/pull/38986
3,168,330,178
PR_kwDOCUB6oc6brNa_
38,986
fix: remove max_size support
{ "login": "BTMogit", "id": 181462976, "node_id": "U_kgDOCtDnwA", "avatar_url": "https://avatars.githubusercontent.com/u/181462976?v=4", "gravatar_id": "", "url": "https://api.github.com/users/BTMogit", "html_url": "https://github.com/BTMogit", "followers_url": "https://api.github.com/users/BTMogit/followers", "following_url": "https://api.github.com/users/BTMogit/following{/other_user}", "gists_url": "https://api.github.com/users/BTMogit/gists{/gist_id}", "starred_url": "https://api.github.com/users/BTMogit/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/BTMogit/subscriptions", "organizations_url": "https://api.github.com/users/BTMogit/orgs", "repos_url": "https://api.github.com/users/BTMogit/repos", "events_url": "https://api.github.com/users/BTMogit/events{/privacy}", "received_events_url": "https://api.github.com/users/BTMogit/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-23T14:03:46
2025-06-23T14:32:54
2025-06-23T14:32:54
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38986", "html_url": "https://github.com/huggingface/transformers/pull/38986", "diff_url": "https://github.com/huggingface/transformers/pull/38986.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38986.patch", "merged_at": null }
Fixed the max_size issue
{ "login": "BTMogit", "id": 181462976, "node_id": "U_kgDOCtDnwA", "avatar_url": "https://avatars.githubusercontent.com/u/181462976?v=4", "gravatar_id": "", "url": "https://api.github.com/users/BTMogit", "html_url": "https://github.com/BTMogit", "followers_url": "https://api.github.com/users/BTMogit/followers", "following_url": "https://api.github.com/users/BTMogit/following{/other_user}", "gists_url": "https://api.github.com/users/BTMogit/gists{/gist_id}", "starred_url": "https://api.github.com/users/BTMogit/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/BTMogit/subscriptions", "organizations_url": "https://api.github.com/users/BTMogit/orgs", "repos_url": "https://api.github.com/users/BTMogit/repos", "events_url": "https://api.github.com/users/BTMogit/events{/privacy}", "received_events_url": "https://api.github.com/users/BTMogit/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38986/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/38986/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38985
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38985/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38985/comments
https://api.github.com/repos/huggingface/transformers/issues/38985/events
https://github.com/huggingface/transformers/pull/38985
3,168,277,638
PR_kwDOCUB6oc6brB63
38,985
Fix BatchEncoding.to() for nested elements
{ "login": "eginhard", "id": 5216613, "node_id": "MDQ6VXNlcjUyMTY2MTM=", "avatar_url": "https://avatars.githubusercontent.com/u/5216613?v=4", "gravatar_id": "", "url": "https://api.github.com/users/eginhard", "html_url": "https://github.com/eginhard", "followers_url": "https://api.github.com/users/eginhard/followers", "following_url": "https://api.github.com/users/eginhard/following{/other_user}", "gists_url": "https://api.github.com/users/eginhard/gists{/gist_id}", "starred_url": "https://api.github.com/users/eginhard/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eginhard/subscriptions", "organizations_url": "https://api.github.com/users/eginhard/orgs", "repos_url": "https://api.github.com/users/eginhard/repos", "events_url": "https://api.github.com/users/eginhard/events{/privacy}", "received_events_url": "https://api.github.com/users/eginhard/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-23T13:47:28
2025-07-18T13:17:30
2025-07-18T13:14:46
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38985", "html_url": "https://github.com/huggingface/transformers/pull/38985", "diff_url": "https://github.com/huggingface/transformers/pull/38985.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38985.patch", "merged_at": "2025-07-18T13:14:46" }
# What does this PR do? Extend `BatchEncoding.to()` to also work for nested elements. When using voice presets in Bark, the processor returns a `BatchEncoding` of - `{ "input_ids": torch.Tensor, "attention_mask": torch.Tensor, "history_prompt": BatchFeature}` Currently, only tensor elements are moved, so running on `cuda` the following code fails with `RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper_CUDA__index_select)`: ```python import scipy import torch from transformers import AutoProcessor from transformers import BarkModel model = BarkModel.from_pretrained("suno/bark-small") device = "cuda:0" if torch.cuda.is_available() else "cpu" model = model.to(device) sampling_rate = model.generation_config.sample_rate processor = AutoProcessor.from_pretrained("suno/bark-small") voice_preset = "v2/en_speaker_6" # prepare the inputs text_prompt = "Let's try generating speech, with Bark, a text-to-speech model" inputs = processor(text_prompt, voice_preset=voice_preset) # generate speech speech_output = model.generate(**inputs.to(device)) scipy.io.wavfile.write("bark_out.wav", rate=sampling_rate, data=speech_output[0].cpu().numpy()) ``` A workaround was to manually do `inputs["history_prompt"].to(device)`. This PR fixes this by moving all nested elements with a callable `to()`. Fixes #34634 ## 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: https://github.com/huggingface/transformers/issues/34634#issuecomment-2996386321 - [ ] 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? @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/38985/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/38985/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38984
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38984/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38984/comments
https://api.github.com/repos/huggingface/transformers/issues/38984/events
https://github.com/huggingface/transformers/issues/38984
3,168,153,670
I_kwDOCUB6oc681jBG
38,984
QA pipeline prediction generates wrong response when `top_k` param > 1
{ "login": "WeichenXu123", "id": 19235986, "node_id": "MDQ6VXNlcjE5MjM1OTg2", "avatar_url": "https://avatars.githubusercontent.com/u/19235986?v=4", "gravatar_id": "", "url": "https://api.github.com/users/WeichenXu123", "html_url": "https://github.com/WeichenXu123", "followers_url": "https://api.github.com/users/WeichenXu123/followers", "following_url": "https://api.github.com/users/WeichenXu123/following{/other_user}", "gists_url": "https://api.github.com/users/WeichenXu123/gists{/gist_id}", "starred_url": "https://api.github.com/users/WeichenXu123/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/WeichenXu123/subscriptions", "organizations_url": "https://api.github.com/users/WeichenXu123/orgs", "repos_url": "https://api.github.com/users/WeichenXu123/repos", "events_url": "https://api.github.com/users/WeichenXu123/events{/privacy}", "received_events_url": "https://api.github.com/users/WeichenXu123/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-06-23T13:09:23
2025-07-17T08:24:31
2025-07-17T08:24:31
NONE
null
null
null
null
### System Info - `transformers` version: 4.53.0.dev0 - Platform: Linux-5.4.0-1128-aws-fips-x86_64-with-glibc2.31 - Python version: 3.11.11 - Huggingface_hub version: 0.33.0 - Safetensors version: 0.5.3 - Accelerate version: 1.8.1 - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (accelerator?): 2.7.1+cu126 (NA) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed ### Who can help? _No response_ ### 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 ``` import transformers architecture = "csarron/mobilebert-uncased-squad-v2" tokenizer = transformers.AutoTokenizer.from_pretrained(architecture, low_cpu_mem_usage=True) model = transformers.MobileBertForQuestionAnswering.from_pretrained( architecture, low_cpu_mem_usage=True ) pipeline = transformers.pipeline(task="question-answering", model=model, tokenizer=tokenizer) data = [ {'question': ['What color is it?', 'How do the people go?', "What does the 'wolf' howl at?"], 'context': [ "Some people said it was green but I know that it's pink.", 'The people on the bus go up and down. Up and down.', "The pack of 'wolves' stood on the cliff and a 'lone wolf' howled at the moon for hours." ]} ] # prediction result is wrong pipeline(data, top_k=2, max_answer_len=5) ``` ### Expected behavior Expected prediction response: ``` [[{'score': 0.5683297514915466, 'start': 51, 'end': 55, 'answer': 'pink'}, {'score': 0.028800610452890396, 'start': 51, 'end': 56, 'answer': 'pink.'}], [{'score': 0.3008899986743927, 'start': 25, 'end': 36, 'answer': 'up and down'}, {'score': 0.12070021033287048, 'start': 38, 'end': 49, 'answer': 'Up and down'}], [{'score': 0.8356598615646362, 'start': 68, 'end': 76, 'answer': 'the moon'}, {'score': 0.0971309095621109, 'start': 72, 'end': 76, 'answer': 'moon'}]] ``` But it gets the following response (**one 'Up and down' answer is missing** ) ``` [[{'score': 0.5683297514915466, 'start': 51, 'end': 55, 'answer': 'pink'}, {'score': 0.028800610452890396, 'start': 51, 'end': 56, 'answer': 'pink.'}], {'score': 0.4215902090072632, 'start': 25, 'end': 36, 'answer': 'up and down'}, [{'score': 0.8356598615646362, 'start': 68, 'end': 76, 'answer': 'the moon'}, {'score': 0.0971309095621109, 'start': 72, 'end': 76, 'answer': 'moon'}]] ```
{ "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/38984/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/38984/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/38983
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38983/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38983/comments
https://api.github.com/repos/huggingface/transformers/issues/38983/events
https://github.com/huggingface/transformers/pull/38983
3,168,007,748
PR_kwDOCUB6oc6bqG2m
38,983
fix: astronomical loss with ModernBERT when using gradient checkpointing (#38982)
{ "login": "umarbutler", "id": 8473183, "node_id": "MDQ6VXNlcjg0NzMxODM=", "avatar_url": "https://avatars.githubusercontent.com/u/8473183?v=4", "gravatar_id": "", "url": "https://api.github.com/users/umarbutler", "html_url": "https://github.com/umarbutler", "followers_url": "https://api.github.com/users/umarbutler/followers", "following_url": "https://api.github.com/users/umarbutler/following{/other_user}", "gists_url": "https://api.github.com/users/umarbutler/gists{/gist_id}", "starred_url": "https://api.github.com/users/umarbutler/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/umarbutler/subscriptions", "organizations_url": "https://api.github.com/users/umarbutler/orgs", "repos_url": "https://api.github.com/users/umarbutler/repos", "events_url": "https://api.github.com/users/umarbutler/events{/privacy}", "received_events_url": "https://api.github.com/users/umarbutler/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-23T12:24:16
2025-06-25T14:11:19
2025-06-25T14:11:19
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38983", "html_url": "https://github.com/huggingface/transformers/pull/38983", "diff_url": "https://github.com/huggingface/transformers/pull/38983.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38983.patch", "merged_at": "2025-06-25T14:11:19" }
@ArthurZucker @SunMarc This PR fixes #38982 by passing `kwargs` to `loss_function()` in the forward function for the ModernBERT MLM block -- no more astronomical loss when using gradient accumulation while training ModernBERT.
{ "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/38983/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/38983/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38982
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38982/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38982/comments
https://api.github.com/repos/huggingface/transformers/issues/38982/events
https://github.com/huggingface/transformers/issues/38982
3,167,996,930
I_kwDOCUB6oc6808wC
38,982
ModernBERT training loss is astronomical when using gradient accumulation
{ "login": "umarbutler", "id": 8473183, "node_id": "MDQ6VXNlcjg0NzMxODM=", "avatar_url": "https://avatars.githubusercontent.com/u/8473183?v=4", "gravatar_id": "", "url": "https://api.github.com/users/umarbutler", "html_url": "https://github.com/umarbutler", "followers_url": "https://api.github.com/users/umarbutler/followers", "following_url": "https://api.github.com/users/umarbutler/following{/other_user}", "gists_url": "https://api.github.com/users/umarbutler/gists{/gist_id}", "starred_url": "https://api.github.com/users/umarbutler/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/umarbutler/subscriptions", "organizations_url": "https://api.github.com/users/umarbutler/orgs", "repos_url": "https://api.github.com/users/umarbutler/repos", "events_url": "https://api.github.com/users/umarbutler/events{/privacy}", "received_events_url": "https://api.github.com/users/umarbutler/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-06-23T12:20:33
2025-06-25T14:11:20
2025-06-25T14:11:20
CONTRIBUTOR
null
null
null
null
### System Info - `transformers` version: 4.52.4 - Platform: Linux-6.6.87.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.12.5 - Huggingface_hub version: 0.33.0 - Safetensors version: 0.5.3 - Accelerate version: 1.8.1 - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (GPU?): 2.7.1+cu126 (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 4090 ### Who can help? @SunMarc @ArthurZucker ### 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 1. Train ModernBERT on MLM with gradient accumulation. ### Expected behavior Loss values should be the same as they would be without gradient accumulation. Instead, they get multiplied by gradient accumulation steps.
{ "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/38982/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/38982/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/38981
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38981/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38981/comments
https://api.github.com/repos/huggingface/transformers/issues/38981/events
https://github.com/huggingface/transformers/issues/38981
3,167,949,459
I_kwDOCUB6oc680xKT
38,981
InternVL3 config missing critical fields after saving
{ "login": "TheDropZone", "id": 13768185, "node_id": "MDQ6VXNlcjEzNzY4MTg1", "avatar_url": "https://avatars.githubusercontent.com/u/13768185?v=4", "gravatar_id": "", "url": "https://api.github.com/users/TheDropZone", "html_url": "https://github.com/TheDropZone", "followers_url": "https://api.github.com/users/TheDropZone/followers", "following_url": "https://api.github.com/users/TheDropZone/following{/other_user}", "gists_url": "https://api.github.com/users/TheDropZone/gists{/gist_id}", "starred_url": "https://api.github.com/users/TheDropZone/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/TheDropZone/subscriptions", "organizations_url": "https://api.github.com/users/TheDropZone/orgs", "repos_url": "https://api.github.com/users/TheDropZone/repos", "events_url": "https://api.github.com/users/TheDropZone/events{/privacy}", "received_events_url": "https://api.github.com/users/TheDropZone/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-06-23T12:05:48
2025-06-23T19:42:54
2025-06-23T19:42:54
NONE
null
null
null
null
### System Info <details> <summary> System Info transformers env output </summary> - `transformers` version: 4.52.4 - Platform: Linux-6.8.0-58-generic-x86_64-with-glibc2.39 - Python version: 3.12.0 - Huggingface_hub version: 0.33.0 - Safetensors version: 0.5.3 - Accelerate version: 1.7.0 - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (GPU?): 2.7.0+cu126 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - GPU type: NVIDIA H100 NVL </details> ### Who can help? vision models: @amyeroberts, @qubvel InternVL: @zucchini-nlp ### Reproduction ## Simple load and config save ``` from transformers import AutoModel, AutoTokenizer, AutoProcessor model = AutoModel.from_pretrained( "OpenGVLab/InternVL3-38B", # behaves for all sizes of InternVL3 device_map="balanced", # Used with multi-gpu setup trust_remote_code=True, # Required for InternVL3 max_memory={i: "92GB" for i in range(torch.cuda.device_count())}, # Used with multi-gpu setup ) model.config.save_pretrained(output_dir) # output to folder on disk ``` ## Load, BNB Quantization and config save ``` quantization_config = BitsAndBytesConfig( load_in_8bit=True, ) model = AutoModel.from_pretrained( "OpenGVLab/InternVL3-38B", # behaves for all sizes of InternVL3 device_map="balanced", # Distribute more evenly across all 4 GPUs trust_remote_code=True, # Required for InternVL3 use_flash_attn=True, quantization_config=quantization_config, max_memory={i: "92GB" for i in range(torch.cuda.device_count())}, ) model.config.save_pretrained(output_dir) # output to folder on disk ``` ### Expected behavior - Saved Config.json isn't missing important fields When comparing the config.json from the original "OpenGVLab/InternVL3-XB" model to the config.json after saving out of transformers AutoModel, the Transformers saved config.json is missing a large number of critical config values. These config values are missing in the "llm_config" (normally named text_config), and "vision_config" sections. See a complete listing of missing fields below. The most notable being missing" "tie_word_embeddings": false", which is causing random/bad outputs when the saved model is loaded and run on tools like vLLM and such ( https://github.com/vllm-project/vllm/issues/19876 ) <details> <summary> Missing config fields </summary> ### llm_config - "_attn_implementation_autoset": true - "add_cross_attention": false - "bad_words_ids": null - "begin_suppress_tokens": null - "chunk_size_feed_forward": 0 - "cross_attention_hidden_size": null - "decoder_start_token_id": null - "diversity_penalty": 0.0 - "do_sample": false - "early_stopping": false - "encoder_no_repeat_ngram_size": 0 - "exponential_decay_length_penalty": null - "finetuning_task": null - "forced_bos_token_id": null - "forced_eos_token_id": null - "id2label": { "0": "LABEL_0", "1": "LABEL_1" } - "is_decoder": false - "is_encoder_decoder": false - "label2id": { "LABEL_0": 0, "LABEL_1": 1 } - "length_penalty": 1.0 - "max_length": 20 - "min_length": 0 - "no_repeat_ngram_size": 0 - "num_beam_groups": 1 - "num_beams": 1 - "num_return_sequences": 1 - "output_attentions": false - "output_hidden_states": false - "output_scores": false - "pad_token_id": null - "prefix": null - "problem_type": null - "pruned_heads": {} - "remove_invalid_values": false - "repetition_penalty": 1.0 - "return_dict": true - "return_dict_in_generate": false - "sep_token_id": null - "suppress_tokens": null - "task_specific_params": null - "temperature": 1.0 - "tf_legacy_loss": false - "tie_encoder_decoder": false - "tie_word_embeddings": false - "tokenizer_class": null - "top_k": 50 - "top_p": 1.0 - "torchscript": false - "transformers_version": "4.48.3" - "typical_p": 1.0 ### vision_config - "_attn_implementation_autoset": true - "add_cross_attention": false - "bad_words_ids": null - "begin_suppress_tokens": null - "bos_token_id": null - "chunk_size_feed_forward": 0 - "cross_attention_hidden_size": null - "decoder_start_token_id": null - "diversity_penalty": 0.0 - "do_sample": false - "early_stopping": false - "encoder_no_repeat_ngram_size": 0 - "eos_token_id": null - "exponential_decay_length_penalty": null - "finetuning_task": null - "forced_bos_token_id": null - "forced_eos_token_id": null - "id2label": { "0": "LABEL_0", "1": "LABEL_1" } - "is_decoder": false - "is_encoder_decoder": false - "label2id": { "LABEL_0": 0, "LABEL_1": 1 } - "length_penalty": 1.0 - "max_length": 20 - "min_length": 0 - "no_repeat_ngram_size": 0 - "num_beam_groups": 1 - "num_beams": 1 - "num_return_sequences": 1 - "output_attentions": false - "output_hidden_states": false - "output_scores": false - "pad_token_id": null - "prefix": null - "problem_type": null - "pruned_heads": {} - "remove_invalid_values": false - "repetition_penalty": 1.0 - "return_dict": true - "return_dict_in_generate": false - "sep_token_id": null - "suppress_tokens": null - "task_specific_params": null - "temperature": 1.0 - "tf_legacy_loss": false - "tie_encoder_decoder": false - "tie_word_embeddings": true - "tokenizer_class": null - "top_k": 50 - "top_p": 1.0 - "torchscript": false - "transformers_version": "4.48.3" - "typical_p": 1.0 </details> The expected behavior would be that - When loading the InternVL3 models into Transformers `AutoModel.from_pretrained`, with or with quantization step, the config.json saved to disk would include ALL required fields from the original InternVL config.json file
{ "login": "TheDropZone", "id": 13768185, "node_id": "MDQ6VXNlcjEzNzY4MTg1", "avatar_url": "https://avatars.githubusercontent.com/u/13768185?v=4", "gravatar_id": "", "url": "https://api.github.com/users/TheDropZone", "html_url": "https://github.com/TheDropZone", "followers_url": "https://api.github.com/users/TheDropZone/followers", "following_url": "https://api.github.com/users/TheDropZone/following{/other_user}", "gists_url": "https://api.github.com/users/TheDropZone/gists{/gist_id}", "starred_url": "https://api.github.com/users/TheDropZone/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/TheDropZone/subscriptions", "organizations_url": "https://api.github.com/users/TheDropZone/orgs", "repos_url": "https://api.github.com/users/TheDropZone/repos", "events_url": "https://api.github.com/users/TheDropZone/events{/privacy}", "received_events_url": "https://api.github.com/users/TheDropZone/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38981/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/38981/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/38980
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38980/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38980/comments
https://api.github.com/repos/huggingface/transformers/issues/38980/events
https://github.com/huggingface/transformers/pull/38980
3,167,861,651
PR_kwDOCUB6oc6bpmzD
38,980
Remove dead protected imports
{ "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-06-23T11:36:48
2025-06-23T11:50:12
2025-06-23T11:44:51
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38980", "html_url": "https://github.com/huggingface/transformers/pull/38980", "diff_url": "https://github.com/huggingface/transformers/pull/38980.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38980.patch", "merged_at": "2025-06-23T11:44:51" }
# What does this PR do? Those are artifacts of `make style`
{ "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/38980/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/38980/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38979
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38979/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38979/comments
https://api.github.com/repos/huggingface/transformers/issues/38979/events
https://github.com/huggingface/transformers/pull/38979
3,167,370,345
PR_kwDOCUB6oc6bn7WO
38,979
[modular] CLI allows positional arguments, and more defaults names for the optional arg
{ "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-06-23T09:00:42
2025-06-23T10:40:02
2025-06-23T10:40:01
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38979", "html_url": "https://github.com/huggingface/transformers/pull/38979", "diff_url": "https://github.com/huggingface/transformers/pull/38979.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38979.patch", "merged_at": "2025-06-23T10:40:01" }
# What does this PR do? As per the title. Allows to do `python modular_model_converter.py <model>` instead of always `python modular_model_converter.py --files_to_parse <model>`. cc @ArthurZucker
{ "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/38979/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/38979/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38978
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38978/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38978/comments
https://api.github.com/repos/huggingface/transformers/issues/38978/events
https://github.com/huggingface/transformers/pull/38978
3,167,318,213
PR_kwDOCUB6oc6bnv9y
38,978
fix `mistral` and `mistral3` tests
{ "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-06-23T08:44:36
2025-06-25T21:10:37
2025-06-23T15:07:18
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38978", "html_url": "https://github.com/huggingface/transformers/pull/38978", "diff_url": "https://github.com/huggingface/transformers/pull/38978.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38978.patch", "merged_at": "2025-06-23T15:07:18" }
# What does this PR do? Mostly update expected values and use `cleanup` to avoid OOM. See some details in a few comments.
{ "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/38978/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/38978/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38977
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38977/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38977/comments
https://api.github.com/repos/huggingface/transformers/issues/38977/events
https://github.com/huggingface/transformers/issues/38977
3,167,278,621
I_kwDOCUB6oc68yNYd
38,977
LMHead is processing redundant tokens in prefill
{ "login": "null-pointer-access", "id": 210762976, "node_id": "U_kgDODI_84A", "avatar_url": "https://avatars.githubusercontent.com/u/210762976?v=4", "gravatar_id": "", "url": "https://api.github.com/users/null-pointer-access", "html_url": "https://github.com/null-pointer-access", "followers_url": "https://api.github.com/users/null-pointer-access/followers", "following_url": "https://api.github.com/users/null-pointer-access/following{/other_user}", "gists_url": "https://api.github.com/users/null-pointer-access/gists{/gist_id}", "starred_url": "https://api.github.com/users/null-pointer-access/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/null-pointer-access/subscriptions", "organizations_url": "https://api.github.com/users/null-pointer-access/orgs", "repos_url": "https://api.github.com/users/null-pointer-access/repos", "events_url": "https://api.github.com/users/null-pointer-access/events{/privacy}", "received_events_url": "https://api.github.com/users/null-pointer-access/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-23T08:32:22
2025-06-25T08:29:02
2025-06-25T08:29:02
CONTRIBUTOR
null
null
null
null
While using `GPT2LMHeadModel.generate()` and compare its performance with vLLM, I noticed a significant inefficiency in the `forward()` implementation of many huggingface models. For example, in the `GPT2LMHeadModel.forward`, `self.lm_head` is applied to all token hidden states, even when called from the `generate()` method, where only the logits of the last token are needed for next-token prediction. This computes logits over the entire sequence and can introduce significant overhead. ```py # src/transformers/models/gpt2/modeling_gpt2.py, line 1233 lm_logits = self.lm_head(hidden_states) ``` Suggested Fix: add a conditional branch in forward() to slice the hidden states before computing logits if it’s a generation step.
{ "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/38977/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/38977/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/38976
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38976/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38976/comments
https://api.github.com/repos/huggingface/transformers/issues/38976/events
https://github.com/huggingface/transformers/pull/38976
3,167,191,967
PR_kwDOCUB6oc6bnUyO
38,976
Fix convert_and_export_with_cache failures for GPU models
{ "login": "Stonepia", "id": 12094956, "node_id": "MDQ6VXNlcjEyMDk0OTU2", "avatar_url": "https://avatars.githubusercontent.com/u/12094956?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Stonepia", "html_url": "https://github.com/Stonepia", "followers_url": "https://api.github.com/users/Stonepia/followers", "following_url": "https://api.github.com/users/Stonepia/following{/other_user}", "gists_url": "https://api.github.com/users/Stonepia/gists{/gist_id}", "starred_url": "https://api.github.com/users/Stonepia/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Stonepia/subscriptions", "organizations_url": "https://api.github.com/users/Stonepia/orgs", "repos_url": "https://api.github.com/users/Stonepia/repos", "events_url": "https://api.github.com/users/Stonepia/events{/privacy}", "received_events_url": "https://api.github.com/users/Stonepia/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-23T08:02:15
2025-07-25T12:21:12
2025-07-17T13:12:33
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38976", "html_url": "https://github.com/huggingface/transformers/pull/38976", "diff_url": "https://github.com/huggingface/transformers/pull/38976.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38976.patch", "merged_at": "2025-07-17T13:12:33" }
# What does this PR do? Fixes #38975 This PR passes `device` to tensor initialization, so to fix the `torch.export` error when the model is on GPU. Otherwise, dynamo will throw errors like `Unhandled FakeTensor Device Propagation for aten.embedding.default, found two different devices cuda:0, cpu'` This PR mainly contains two parts: 1. Infer device information from the model and make all the `torch.tensor()` initialization contains device information. 2. Change the corresponding tests from CPU only to `torch_device`. ## 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, @SunMarc and @qgallouedec - 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": "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/38976/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/38976/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38975
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38975/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38975/comments
https://api.github.com/repos/huggingface/transformers/issues/38975/events
https://github.com/huggingface/transformers/issues/38975
3,167,169,511
I_kwDOCUB6oc68xyvn
38,975
[torch.export] Unhandled FakeTensor Device Propagation for two different devices
{ "login": "Stonepia", "id": 12094956, "node_id": "MDQ6VXNlcjEyMDk0OTU2", "avatar_url": "https://avatars.githubusercontent.com/u/12094956?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Stonepia", "html_url": "https://github.com/Stonepia", "followers_url": "https://api.github.com/users/Stonepia/followers", "following_url": "https://api.github.com/users/Stonepia/following{/other_user}", "gists_url": "https://api.github.com/users/Stonepia/gists{/gist_id}", "starred_url": "https://api.github.com/users/Stonepia/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Stonepia/subscriptions", "organizations_url": "https://api.github.com/users/Stonepia/orgs", "repos_url": "https://api.github.com/users/Stonepia/repos", "events_url": "https://api.github.com/users/Stonepia/events{/privacy}", "received_events_url": "https://api.github.com/users/Stonepia/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-06-23T07:55:36
2025-07-17T13:12:34
2025-07-17T13:12:34
CONTRIBUTOR
null
null
null
null
### System Info transformer version: latest main 3d2c6b90914823c78809874f56e3dfecb1b7105c (06/23) ### Who can help? _No response_ ### Information - [ ] The official example scripts - [x] 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 Current `torch.export` feature only tests on CPU. When changed the following tests' device from `cpu` to `torch_device`. The error will happen. https://github.com/huggingface/transformers/blob/2166b6b4ff09f6dd3867ab982f262f66482aa968/tests/utils/test_cache_utils.py#L637 ``` Unhandled FakeTensor Device Propagation for aten.embedding.default, found two different devices cuda:0, cpu') ``` ### Expected behavior The error happens similar like below. THe root cause is that there are some hard-coded tensor that is on CPU. https://github.com/huggingface/transformers/blob/2166b6b4ff09f6dd3867ab982f262f66482aa968/src/transformers/integrations/executorch.py#L356 ``` File "/root/miniforge3/envs/torch_env/lib/python3.10/site-packages/torch/_subclasses/fake_tensor.py", line 924, in _find_common_device merge_devices(arg) File "/root/miniforge3/envs/torch_env/lib/python3.10/site-packages/torch/_subclasses/fake_tensor.py", line 919, in merge_devices raise RuntimeError( torch._dynamo.exc.TorchRuntimeError: Dynamo failed to run FX node with fake tensors: call_module L__self___model_model_embed_tokens(*(FakeTensor(..., size=(1, 1), dtype=torch.int64),), **{}): got RuntimeError('Unhandled FakeTensor Device Propagation for aten.embedding.default, found two different devices cuda:0, cpu') from user code: File "/root/miniforge3/envs/torch_env/lib/python3.10/site-packages/transformers-4.48.3-py3.10.egg/transformers/integrations/executorch.py", line 111, in forward outs = self.model( File "/root/miniforge3/envs/torch_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1766, in _call_impl return forward_call(*args, **kwargs) File "/root/miniforge3/envs/torch_env/lib/python3.10/site-packages/transformers-4.48.3-py3.10.egg/transformers/models/llama/modeling_llama.py", line 834, in forward outputs = self.model( File "/root/miniforge3/envs/torch_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1766, in _call_impl return forward_call(*args, **kwargs) File "/root/miniforge3/envs/torch_env/lib/python3.10/site-packages/transformers-4.48.3-py3.10.egg/transformers/models/llama/modeling_llama.py", line 548, in forward inputs_embeds = self.embed_tokens(input_ids) ```
{ "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/38975/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/38975/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/38974
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38974/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38974/comments
https://api.github.com/repos/huggingface/transformers/issues/38974/events
https://github.com/huggingface/transformers/pull/38974
3,167,025,407
PR_kwDOCUB6oc6bmxKB
38,974
[refactor] set attention implementation
{ "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-06-23T07:02:28
2025-07-29T08:18:27
2025-07-15T07:34:06
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38974", "html_url": "https://github.com/huggingface/transformers/pull/38974", "diff_url": "https://github.com/huggingface/transformers/pull/38974.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38974.patch", "merged_at": "2025-07-15T07:34:06" }
# What does this PR do? As per title, refactors attention implementation setting and makes it a public API. We should encourage users to `model.set_attn_implementation()` whenever they want to change it after loading the model, instead of setting config's private attr `model.config._attn_implementation="sdpa"` After the clean-up, we will be calling attention implementation setter only once per pretrained model class, when init the module. Since `from_pretrained/from_config` at the end call `init`, we don't need to keep it as a `classmethod`. Also setting attention after init allows us to know which backbones support attn or do not, and might be useful of we want to early raise errors in the future versions. Also, removed redundant flags for FA2/FA3. Realized that we can use one flag for both versions :)
{ "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/38974/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/38974/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38973
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38973/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38973/comments
https://api.github.com/repos/huggingface/transformers/issues/38973/events
https://github.com/huggingface/transformers/issues/38973
3,166,652,893
I_kwDOCUB6oc68v0nd
38,973
ImportError: cannot import name 'DTensor' from 'torch.distributed.tensor'
{ "login": "ChinDer", "id": 20189183, "node_id": "MDQ6VXNlcjIwMTg5MTgz", "avatar_url": "https://avatars.githubusercontent.com/u/20189183?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ChinDer", "html_url": "https://github.com/ChinDer", "followers_url": "https://api.github.com/users/ChinDer/followers", "following_url": "https://api.github.com/users/ChinDer/following{/other_user}", "gists_url": "https://api.github.com/users/ChinDer/gists{/gist_id}", "starred_url": "https://api.github.com/users/ChinDer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ChinDer/subscriptions", "organizations_url": "https://api.github.com/users/ChinDer/orgs", "repos_url": "https://api.github.com/users/ChinDer/repos", "events_url": "https://api.github.com/users/ChinDer/events{/privacy}", "received_events_url": "https://api.github.com/users/ChinDer/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-06-23T03:42:51
2025-06-23T13:27:06
2025-06-23T13:27:06
NONE
null
null
null
null
### System Info my env list: archspec 0.2.5 boltons 24.0.0 Brotli 1.1.0 certifi 2025.4.26 cffi 1.17.1 charset-normalizer 3.4.2 colorama 0.4.6 conda 25.3.0 conda-libmamba-solver 25.3.0 conda-package-handling 2.4.0 conda_package_streaming 0.11.0 distro 1.9.0 filelock 3.18.0 frozendict 2.4.6 fsspec 2025.5.1 h2 4.2.0 hf-xet 1.1.4 hpack 4.1.0 huggingface-hub 0.33.0 hyperframe 6.1.0 idna 3.10 Jinja2 3.1.6 jsonpatch 1.33 jsonpointer 3.0.0 libmambapy 2.1.1 MarkupSafe 3.0.2 menuinst 2.2.0 mpmath 1.3.0 networkx 3.5 numpy 2.3.0 packaging 25.0 pillow 11.2.1 pip 25.1.1 platformdirs 4.3.8 pluggy 1.5.0 pycosat 0.6.6 pycparser 2.22 PySocks 1.7.1 PyYAML 6.0.2 regex 2024.11.6 requests 2.32.3 ruamel.yaml 0.18.10 ruamel.yaml.clib 0.2.8 safetensors 0.5.3 setuptools 80.1.0 sympy 1.14.0 tokenizers 0.21.1 torch 2.8.0.dev20250619 torchaudio 2.8.0.dev20250619 torchvision 0.23.0.dev20250619 tqdm 4.67.1 transformers 4.52.4 truststore 0.10.1 typing_extensions 4.14.0 urllib3 2.4.0 wheel 0.45.1 zstandard 0.23.0 ### 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 Traceback (most recent call last): File "/Users/edy/Documents/work/distil_bert/main.py", line 42, in <module> trainer.train() File "/Users/edy/miniforge3/bin/.venv/lib/python3.11/site-packages/transformers/trainer.py", line 2240, in train return inner_training_loop( ^^^^^^^^^^^^^^^^^^^^ File "/Users/edy/miniforge3/bin/.venv/lib/python3.11/site-packages/transformers/trainer.py", line 2622, in _inner_training_loop self._maybe_log_save_evaluate( File "/Users/edy/miniforge3/bin/.venv/lib/python3.11/site-packages/transformers/trainer.py", line 3102, in _maybe_log_save_evaluate self._save_checkpoint(model, trial) File "/Users/edy/miniforge3/bin/.venv/lib/python3.11/site-packages/transformers/trainer.py", line 3199, in _save_checkpoint self.save_model(output_dir, _internal_call=True) File "/Users/edy/miniforge3/bin/.venv/lib/python3.11/site-packages/transformers/trainer.py", line 3911, in save_model self._save(output_dir) File "/Users/edy/miniforge3/bin/.venv/lib/python3.11/site-packages/transformers/trainer.py", line 4015, in _save self.model.save_pretrained( File "/Users/edy/miniforge3/bin/.venv/lib/python3.11/site-packages/transformers/modeling_utils.py", line 3572, in save_pretrained ptrs[id_tensor_storage(tensor)].append(name) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/edy/miniforge3/bin/.venv/lib/python3.11/site-packages/transformers/pytorch_utils.py", line 300, in id_tensor_storage from torch.distributed.tensor import DTensor ImportError: cannot import name 'DTensor' from 'torch.distributed.tensor' (/Users/edy/miniforge3/bin/.venv/lib/python3.11/site-packages/torch/distributed/tensor/__init__.py) ### Expected behavior I found the same issue, but it has not been fixed: https://github.com/huggingface/transformers/issues/38639
{ "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/38973/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/38973/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/38972
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38972/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38972/comments
https://api.github.com/repos/huggingface/transformers/issues/38972/events
https://github.com/huggingface/transformers/pull/38972
3,166,390,664
PR_kwDOCUB6oc6bkplB
38,972
Support for Flash Attention 3
{ "login": "EduardDurech", "id": 39579228, "node_id": "MDQ6VXNlcjM5NTc5MjI4", "avatar_url": "https://avatars.githubusercontent.com/u/39579228?v=4", "gravatar_id": "", "url": "https://api.github.com/users/EduardDurech", "html_url": "https://github.com/EduardDurech", "followers_url": "https://api.github.com/users/EduardDurech/followers", "following_url": "https://api.github.com/users/EduardDurech/following{/other_user}", "gists_url": "https://api.github.com/users/EduardDurech/gists{/gist_id}", "starred_url": "https://api.github.com/users/EduardDurech/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/EduardDurech/subscriptions", "organizations_url": "https://api.github.com/users/EduardDurech/orgs", "repos_url": "https://api.github.com/users/EduardDurech/repos", "events_url": "https://api.github.com/users/EduardDurech/events{/privacy}", "received_events_url": "https://api.github.com/users/EduardDurech/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-23T00:11:13
2025-08-25T12:56:18
2025-06-25T12:39:27
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38972", "html_url": "https://github.com/huggingface/transformers/pull/38972", "diff_url": "https://github.com/huggingface/transformers/pull/38972.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38972.patch", "merged_at": "2025-06-25T12:39:27" }
Supports Flash Attention 3 for `_flash_attention_forward` Previous https://github.com/huggingface/transformers/pull/36190 @ArthurZucker Parity test Flash Attention {2,3} based on https://github.com/sgl-project/sglang/blob/main/test/srt/models/test_generation_models.py ```python $ RUN_SLOW=1 pytest -s tests/generation/test_flash_attention_parity.py > ============================================================================================================ test session starts ============================================================================================================ platform linux -- Python 3.12.3, pytest-8.1.1, pluggy-1.6.0 rootdir: /workspace/transformers configfile: pyproject.toml plugins: hydra-core-1.3.2, xdist-3.6.1, rerunfailures-15.1, hypothesis-6.130.8, shard-0.1.2, xdoctest-1.0.2, flakefinder-1.1.0, anyio-4.9.0, typeguard-4.3.0 collected 1 item Running 1 items in this shard tests/generation/test_flash_attention_parity.py::FlashAttentionParityTest::test_flash_attention_2_3_parity You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with `model.to('cuda')`. You are attempting to use Flash Attention 3 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with `model.to('cuda')`. --- Flash Attention (2, 3) Parity Test on meta-llama/Llama-3.2-1B-Instruct --- Prompt: 'The ETH AI Center is' Generated text with Flash Attention 2: The ETH AI Center is a research center that focuses on the development of artificial intelligence and its applications in various fields. The center Generated text with Flash Attention 3: The ETH AI Center is a research center that focuses on the development of artificial intelligence and its applications in various fields. The center ROUGE-L: 1.0 Max absolute difference in logprobs: 0.00000e+00 Flash Attention 2 latency: 287.42 ms Flash Attention 3 latency: 272.10 ms Speed-up: 1.06x --- PASSED ============================================================================================================= warnings summary ============================================================================================================== <frozen importlib._bootstrap>:488 <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14. <frozen importlib._bootstrap>:488 <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.ScalarMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14. ../../usr/local/lib/python3.12/dist-packages/google/protobuf/internal/well_known_types.py:93 /usr/local/lib/python3.12/dist-packages/google/protobuf/internal/well_known_types.py:93: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC). _EPOCH_DATETIME_NAIVE = datetime.datetime.utcfromtimestamp(0) ../../usr/local/lib/python3.12/dist-packages/_pytest/config/__init__.py:1439 /usr/local/lib/python3.12/dist-packages/_pytest/config/__init__.py:1439: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================================================================================================= 1 passed, 4 warnings in 8.18s ======================================================================================================= ``` Closes https://github.com/huggingface/transformers/issues/32219, https://github.com/huggingface/transformers/issues/33373
{ "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/38972/reactions", "total_count": 6, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 3, "rocket": 1, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/38972/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38971
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38971/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38971/comments
https://api.github.com/repos/huggingface/transformers/issues/38971/events
https://github.com/huggingface/transformers/pull/38971
3,166,363,564
PR_kwDOCUB6oc6bkkMY
38,971
Update PEGASUS-X model card
{ "login": "dross20", "id": 73395516, "node_id": "MDQ6VXNlcjczMzk1NTE2", "avatar_url": "https://avatars.githubusercontent.com/u/73395516?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dross20", "html_url": "https://github.com/dross20", "followers_url": "https://api.github.com/users/dross20/followers", "following_url": "https://api.github.com/users/dross20/following{/other_user}", "gists_url": "https://api.github.com/users/dross20/gists{/gist_id}", "starred_url": "https://api.github.com/users/dross20/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dross20/subscriptions", "organizations_url": "https://api.github.com/users/dross20/orgs", "repos_url": "https://api.github.com/users/dross20/repos", "events_url": "https://api.github.com/users/dross20/events{/privacy}", "received_events_url": "https://api.github.com/users/dross20/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-22T23:30:22
2025-06-26T20:54:54
2025-06-26T20:54:48
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38971", "html_url": "https://github.com/huggingface/transformers/pull/38971", "diff_url": "https://github.com/huggingface/transformers/pull/38971.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38971.patch", "merged_at": "2025-06-26T20:54:48" }
# What does this PR do? This PR replaces the PEGASUS-X model card with a new model card matching the format introduced in #36979. ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). ## Who can review? @stevhliu ## Notes - Used FP32 instead of FP16 for inference examples since PEGASUS-X doesn't support FP16. - Removed SDPA badge and omitted `attn_implementation="sdpa"` since PEGASUS-X doesn't support SDPA: https://github.com/huggingface/transformers/blob/2166b6b4ff09f6dd3867ab982f262f66482aa968/src/transformers/models/pegasus_x/modeling_pegasus_x.py#L766
{ "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/38971/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/38971/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38970
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38970/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38970/comments
https://api.github.com/repos/huggingface/transformers/issues/38970/events
https://github.com/huggingface/transformers/issues/38970
3,165,916,670
I_kwDOCUB6oc68tA3-
38,970
Global and Local Anomaly co-Synthesis Strategy (GLASS)
{ "login": "sbrzz", "id": 5716727, "node_id": "MDQ6VXNlcjU3MTY3Mjc=", "avatar_url": "https://avatars.githubusercontent.com/u/5716727?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sbrzz", "html_url": "https://github.com/sbrzz", "followers_url": "https://api.github.com/users/sbrzz/followers", "following_url": "https://api.github.com/users/sbrzz/following{/other_user}", "gists_url": "https://api.github.com/users/sbrzz/gists{/gist_id}", "starred_url": "https://api.github.com/users/sbrzz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sbrzz/subscriptions", "organizations_url": "https://api.github.com/users/sbrzz/orgs", "repos_url": "https://api.github.com/users/sbrzz/repos", "events_url": "https://api.github.com/users/sbrzz/events{/privacy}", "received_events_url": "https://api.github.com/users/sbrzz/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-06-22T12:28:19
2025-06-23T20:55:16
2025-06-23T20:55:15
NONE
null
null
null
null
### Model description Hi 🤗 Transformers team, I would like to contribute a new model to the library: GLASS – A Unified Anomaly Synthesis Strategy with Gradient Ascent for Industrial Anomaly Detection and Localization 📄 Paper: https://arxiv.org/abs/2407.09359 💻 Code: https://github.com/cqylunlun/GLASS GLASS is a novel approach for industrial anomaly detection. It uses gradient ascent in the latent space to synthesize diverse and controllable anomalies, which improves both detection and localization. I believe this model could be valuable for users working on visual inspection and quality control tasks in manufacturing and related domains. Would the maintainers be interested in having this model integrated into Transformers? If so, I’d be happy to start working on a PR. Looking forward to your feedback! ### Open source status - [x] The model implementation is available - [ ] The model weights are available ### Provide useful links for the implementation _No response_
{ "login": "sbrzz", "id": 5716727, "node_id": "MDQ6VXNlcjU3MTY3Mjc=", "avatar_url": "https://avatars.githubusercontent.com/u/5716727?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sbrzz", "html_url": "https://github.com/sbrzz", "followers_url": "https://api.github.com/users/sbrzz/followers", "following_url": "https://api.github.com/users/sbrzz/following{/other_user}", "gists_url": "https://api.github.com/users/sbrzz/gists{/gist_id}", "starred_url": "https://api.github.com/users/sbrzz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sbrzz/subscriptions", "organizations_url": "https://api.github.com/users/sbrzz/orgs", "repos_url": "https://api.github.com/users/sbrzz/repos", "events_url": "https://api.github.com/users/sbrzz/events{/privacy}", "received_events_url": "https://api.github.com/users/sbrzz/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38970/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/38970/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/38969
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38969/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38969/comments
https://api.github.com/repos/huggingface/transformers/issues/38969/events
https://github.com/huggingface/transformers/pull/38969
3,165,884,275
PR_kwDOCUB6oc6bjFat
38,969
Updated Megatron conversion script for gpt2 checkpoints
{ "login": "LckyLke", "id": 61435401, "node_id": "MDQ6VXNlcjYxNDM1NDAx", "avatar_url": "https://avatars.githubusercontent.com/u/61435401?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LckyLke", "html_url": "https://github.com/LckyLke", "followers_url": "https://api.github.com/users/LckyLke/followers", "following_url": "https://api.github.com/users/LckyLke/following{/other_user}", "gists_url": "https://api.github.com/users/LckyLke/gists{/gist_id}", "starred_url": "https://api.github.com/users/LckyLke/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LckyLke/subscriptions", "organizations_url": "https://api.github.com/users/LckyLke/orgs", "repos_url": "https://api.github.com/users/LckyLke/repos", "events_url": "https://api.github.com/users/LckyLke/events{/privacy}", "received_events_url": "https://api.github.com/users/LckyLke/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-22T11:38:45
2025-07-16T15:54:30
2025-07-16T15:54:29
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38969", "html_url": "https://github.com/huggingface/transformers/pull/38969", "diff_url": "https://github.com/huggingface/transformers/pull/38969.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38969.patch", "merged_at": "2025-07-16T15:54:29" }
This PR updates the convert_megatron_gpt2_checkpoint script to the newest Megatron version!
{ "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/38969/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/38969/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38968
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38968/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38968/comments
https://api.github.com/repos/huggingface/transformers/issues/38968/events
https://github.com/huggingface/transformers/issues/38968
3,165,784,839
I_kwDOCUB6oc68sgsH
38,968
Wandb isn't logging config in offline mode
{ "login": "souththzz", "id": 82267904, "node_id": "MDQ6VXNlcjgyMjY3OTA0", "avatar_url": "https://avatars.githubusercontent.com/u/82267904?v=4", "gravatar_id": "", "url": "https://api.github.com/users/souththzz", "html_url": "https://github.com/souththzz", "followers_url": "https://api.github.com/users/souththzz/followers", "following_url": "https://api.github.com/users/souththzz/following{/other_user}", "gists_url": "https://api.github.com/users/souththzz/gists{/gist_id}", "starred_url": "https://api.github.com/users/souththzz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/souththzz/subscriptions", "organizations_url": "https://api.github.com/users/souththzz/orgs", "repos_url": "https://api.github.com/users/souththzz/repos", "events_url": "https://api.github.com/users/souththzz/events{/privacy}", "received_events_url": "https://api.github.com/users/souththzz/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-06-22T08:55:24
2025-07-23T12:26:14
2025-07-23T12:26:14
NONE
null
null
null
null
### System Info - transformers version: 4.52.4 - Platform: Linux-5.4.0-215-generic-x86_64-with-glibc2.31 - Python version: 3.11.11 - Accelerate version: 1.8.1 - Wandb version: 0.20.1 ### Who can help? _No response_ ### 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 The key code simply enables the offline mode of wandb. ``` os.environ["WANDB_PROJECT"] = "test" os.environ["WANDB_MODE"] = "offline" trainer = Trainer( model=model, args=TrainingArguments( report_to="wandb", run_name="tmp-10-offline", ), train_dataset=ds_train, eval_dataset=ds_eval, ) ``` It can record loss, but there is no parameter configuration. ![Image](https://github.com/user-attachments/assets/4cc1f876-6921-44c3-9ec9-b9fb953ea008) ### Expected behavior Log parameter config in offline mode, just like in online mode.
{ "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/38968/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/38968/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/38967
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38967/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38967/comments
https://api.github.com/repos/huggingface/transformers/issues/38967/events
https://github.com/huggingface/transformers/pull/38967
3,165,634,926
PR_kwDOCUB6oc6biVzs
38,967
Add ModernBERT Decoder Models - ModernBERT, but trained with CLM!
{ "login": "orionw", "id": 31665361, "node_id": "MDQ6VXNlcjMxNjY1MzYx", "avatar_url": "https://avatars.githubusercontent.com/u/31665361?v=4", "gravatar_id": "", "url": "https://api.github.com/users/orionw", "html_url": "https://github.com/orionw", "followers_url": "https://api.github.com/users/orionw/followers", "following_url": "https://api.github.com/users/orionw/following{/other_user}", "gists_url": "https://api.github.com/users/orionw/gists{/gist_id}", "starred_url": "https://api.github.com/users/orionw/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/orionw/subscriptions", "organizations_url": "https://api.github.com/users/orionw/orgs", "repos_url": "https://api.github.com/users/orionw/repos", "events_url": "https://api.github.com/users/orionw/events{/privacy}", "received_events_url": "https://api.github.com/users/orionw/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-22T03:52:17
2025-07-15T13:48:32
2025-07-15T08:40:41
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38967", "html_url": "https://github.com/huggingface/transformers/pull/38967", "diff_url": "https://github.com/huggingface/transformers/pull/38967.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38967.patch", "merged_at": "2025-07-15T08:40:41" }
This PR adds the new ModernBERTDecoder architecture: it's ModernBERT but trained from scratch as a CLM! This replaces my attempt in #35946 to fit them all in one class. Instead I'll have a script to convert them from encoders to decoders and vice versa by renaming the class and head name (`head` vs `lm_head`) The models/paper are ready to go, but we wanted to have this up before we do the official release so we can have all the release artifacts ready. Thanks again for all your help on the last PR and for suggesting this approach! FAQs: Q: Why don't we just add this to ModernBERT? A: Because we discussed in #35946 that it was too complicated to add the causal attention combined with everything else. This keeps it simpler and uses the standard attention functions Q: How can BERT be a decoder? A: It's really the "ModernBERT" architecture trained from scratch via CLM. It's not MLM at all. We could rename the architecture to whatever we decide to name it in the paper, if that's preferable. But I thought this was the easiest to understand since they share the same everything else. ## 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). - [x] Did you write any new necessary tests? ## Who can review? @Rocketknight1 @gante @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/38967/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/38967/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38966
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38966/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38966/comments
https://api.github.com/repos/huggingface/transformers/issues/38966/events
https://github.com/huggingface/transformers/issues/38966
3,165,463,153
I_kwDOCUB6oc68rSJx
38,966
Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Models
{ "login": "AshAnand34", "id": 84689683, "node_id": "MDQ6VXNlcjg0Njg5Njgz", "avatar_url": "https://avatars.githubusercontent.com/u/84689683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AshAnand34", "html_url": "https://github.com/AshAnand34", "followers_url": "https://api.github.com/users/AshAnand34/followers", "following_url": "https://api.github.com/users/AshAnand34/following{/other_user}", "gists_url": "https://api.github.com/users/AshAnand34/gists{/gist_id}", "starred_url": "https://api.github.com/users/AshAnand34/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AshAnand34/subscriptions", "organizations_url": "https://api.github.com/users/AshAnand34/orgs", "repos_url": "https://api.github.com/users/AshAnand34/repos", "events_url": "https://api.github.com/users/AshAnand34/events{/privacy}", "received_events_url": "https://api.github.com/users/AshAnand34/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-06-21T22:03:19
2025-07-10T14:32:29
null
CONTRIBUTOR
null
null
null
null
### Model description Nemotron-H is a family of hybrid Mamba-Transformer models developed by NVIDIA that combines the efficiency of Mamba layers with the accuracy of Transformer architecture. The models come in two sizes: - 8B parameter model - 56B/47B parameter models (with a compressed 47B version using MiniPuzzle compression) **Key Features:** - **Hybrid Architecture:** Replaces majority of self-attention layers with Mamba layers for constant computation and memory per token - **Superior Performance:** Up to 3x faster inference compared to similarly-sized state-of-the-art Transformer models - **Competitive Accuracy:** Achieves better or on-par accuracy compared to Qwen-2.5-7B/72B and Llama-3.1-8B/70B - **FP8 Training:** Introduces FP8-based training recipe achieving on-par results with BF16 training - **Compression Technique:** MiniPuzzle compression reduces 56B model to 47B while maintaining accuracy and improving inference speed by 20% **Technical Innovations:** - Constant computation and memory requirements per generated token - Novel compression via pruning and distillation technique (MiniPuzzle) - FP8 training recipe for efficient training - Hybrid Mamba-Transformer architecture optimization ### Open source status - [x] The model implementation is available - [x] The model weights are available ### Provide useful links for the implementation HF model: https://huggingface.co/nvidia/Nemotron-H-8B-Base-8K/tree/main arXiv paper: https://arxiv.org/abs/2504.03624 I would definitely love to integrate this into Transformers.
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38966/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/38966/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/38965
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38965/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38965/comments
https://api.github.com/repos/huggingface/transformers/issues/38965/events
https://github.com/huggingface/transformers/issues/38965
3,165,328,235
I_kwDOCUB6oc68qxNr
38,965
Modernbert implementation with Tensorflow
{ "login": "lfoppiano", "id": 15426, "node_id": "MDQ6VXNlcjE1NDI2", "avatar_url": "https://avatars.githubusercontent.com/u/15426?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lfoppiano", "html_url": "https://github.com/lfoppiano", "followers_url": "https://api.github.com/users/lfoppiano/followers", "following_url": "https://api.github.com/users/lfoppiano/following{/other_user}", "gists_url": "https://api.github.com/users/lfoppiano/gists{/gist_id}", "starred_url": "https://api.github.com/users/lfoppiano/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lfoppiano/subscriptions", "organizations_url": "https://api.github.com/users/lfoppiano/orgs", "repos_url": "https://api.github.com/users/lfoppiano/repos", "events_url": "https://api.github.com/users/lfoppiano/events{/privacy}", "received_events_url": "https://api.github.com/users/lfoppiano/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" } ]
closed
false
null
[]
null
[]
2025-06-21T18:52:50
2025-06-23T15:17:50
2025-06-23T15:17:49
NONE
null
null
null
null
Hi all! I've noticed that ModernBERT [does not have an implementation in tensorflow](https://github.com/huggingface/transformers/issues/37128#issuecomment-2766235185) and I was looking into it. I'm checking this https://huggingface.co/docs/transformers/main/add_tensorflow_model and I noticed that it's talking about `modelling_modelname.py`, however at the head of the file `modeling_modernbert.py` there is a warning saying ``` # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/modernbert/modular_modernbert.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # the file from the modular. If any change should be done, please apply the change to the # modular_modernbert.py file directly. One of our CI enforces this. # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # Copyright 2024 Answer.AI, LightOn, and contributors, and the HuggingFace Inc. team. All rights reserved. # ``` What does that means and is there any other implementation having the same principles? ### Motivation I need Modernbert to work with [DeLFT](https://github.com/kermitt2/delft) through huggingface, and the implementation is mainly tensorflow there. ### Your contribution I would like to propose a PR but I need a little bit of help in starting up.
{ "login": "lfoppiano", "id": 15426, "node_id": "MDQ6VXNlcjE1NDI2", "avatar_url": "https://avatars.githubusercontent.com/u/15426?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lfoppiano", "html_url": "https://github.com/lfoppiano", "followers_url": "https://api.github.com/users/lfoppiano/followers", "following_url": "https://api.github.com/users/lfoppiano/following{/other_user}", "gists_url": "https://api.github.com/users/lfoppiano/gists{/gist_id}", "starred_url": "https://api.github.com/users/lfoppiano/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lfoppiano/subscriptions", "organizations_url": "https://api.github.com/users/lfoppiano/orgs", "repos_url": "https://api.github.com/users/lfoppiano/repos", "events_url": "https://api.github.com/users/lfoppiano/events{/privacy}", "received_events_url": "https://api.github.com/users/lfoppiano/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38965/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/38965/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/38964
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38964/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38964/comments
https://api.github.com/repos/huggingface/transformers/issues/38964/events
https://github.com/huggingface/transformers/pull/38964
3,165,152,956
PR_kwDOCUB6oc6bg1Ar
38,964
[docs] Typos - Single GPU efficient training features
{ "login": "casinca", "id": 47400729, "node_id": "MDQ6VXNlcjQ3NDAwNzI5", "avatar_url": "https://avatars.githubusercontent.com/u/47400729?v=4", "gravatar_id": "", "url": "https://api.github.com/users/casinca", "html_url": "https://github.com/casinca", "followers_url": "https://api.github.com/users/casinca/followers", "following_url": "https://api.github.com/users/casinca/following{/other_user}", "gists_url": "https://api.github.com/users/casinca/gists{/gist_id}", "starred_url": "https://api.github.com/users/casinca/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/casinca/subscriptions", "organizations_url": "https://api.github.com/users/casinca/orgs", "repos_url": "https://api.github.com/users/casinca/repos", "events_url": "https://api.github.com/users/casinca/events{/privacy}", "received_events_url": "https://api.github.com/users/casinca/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-21T15:01:33
2025-06-23T19:34:12
2025-06-23T19:33:10
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38964", "html_url": "https://github.com/huggingface/transformers/pull/38964", "diff_url": "https://github.com/huggingface/transformers/pull/38964.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38964.patch", "merged_at": "2025-06-23T19:33:10" }
# What does this PR do? - fixed a typo in the Mixed precision section for the `TrainingArguments` class configuration with `bf16` dtype - fixed/synced summary table with the outlines: I believe it should have been SDPA (Scaled dot product attention) and not PEFT. I've also edited yes/yes for SDPA for both memory and speed. There is no mention of PEFT in the file. PEFT has its own dedicated markdown file. Technically it still falls under memory efficient features, it could still be kept/added in the table but it can be confusing without any sections/mentions of it. I'll leave that decision to you. ![image](https://github.com/user-attachments/assets/29a6333c-3e0d-4b4b-81c8-557043b0c0c8) ## 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? Only tagging people who have committed to this file in the last week: @ArthurZucker @stevhliu
{ "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/38964/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/38964/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38963
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38963/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38963/comments
https://api.github.com/repos/huggingface/transformers/issues/38963/events
https://github.com/huggingface/transformers/issues/38963
3,165,025,819
I_kwDOCUB6oc68pnYb
38,963
RuntimeError: Index put requires the source and destination dtypes match, got Half for the destination and Float for the source.
{ "login": "sinngam-khaidem", "id": 108847766, "node_id": "U_kgDOBnzilg", "avatar_url": "https://avatars.githubusercontent.com/u/108847766?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sinngam-khaidem", "html_url": "https://github.com/sinngam-khaidem", "followers_url": "https://api.github.com/users/sinngam-khaidem/followers", "following_url": "https://api.github.com/users/sinngam-khaidem/following{/other_user}", "gists_url": "https://api.github.com/users/sinngam-khaidem/gists{/gist_id}", "starred_url": "https://api.github.com/users/sinngam-khaidem/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sinngam-khaidem/subscriptions", "organizations_url": "https://api.github.com/users/sinngam-khaidem/orgs", "repos_url": "https://api.github.com/users/sinngam-khaidem/repos", "events_url": "https://api.github.com/users/sinngam-khaidem/events{/privacy}", "received_events_url": "https://api.github.com/users/sinngam-khaidem/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-06-21T11:44:03
2025-07-08T06:04:11
2025-07-08T06:03:04
NONE
null
null
null
null
### System Info - `transformers` version: 4.53.0.dev0 - Platform: Linux-5.4.0-113-generic-x86_64-with-glibc2.39 - Python version: 3.10.18 - Huggingface_hub version: 0.33.0 - Safetensors version: 0.5.3 - Accelerate version: 1.7.0 - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (accelerator?): 2.7.0+cu126 (CUDA) - 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 A100-SXM4-80GB ### Who can help? @amyeroberts @qubvel @zach-huggingface @SunMarc @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, ...) - [x] My own task or dataset (give details below) ### Reproduction I was trying to finetune Idefics2 (8B) on custom dataset(that conists of text-image pairs) using the notebook <a href = "https://colab.research.google.com/drive/1NtcTgRbSBKN7pYD3Vdx1j9m8pt3fhFDB?usp=sharing">Idefics2 Finetuning Tutorial</a> when I ran into the following error. <img width="1679" alt="Image" src="https://github.com/user-attachments/assets/1bd79661-0c37-42b8-ab3f-6ddea4ef9277" /> I made small modifications to the hyperparameters for my use case. ### Training Arguments ```python training_args = TrainingArguments( eval_strategy="steps", eval_steps=3, max_steps = 30, per_device_train_batch_size=8, per_device_eval_batch_size=8, gradient_accumulation_steps=4, warmup_steps=5, learning_rate=2e-4, weight_decay=0.01, output_dir="output", bf16=True, remove_unused_columns=False, run_name="run01", report_to="wandb", ) ``` ### Data Collator ```python class MyDataCollator: def __init__(self, processor): self.processor = processor self.processor.tokenizer.add_special_tokens({ "additional_special_tokens": ["<end_of_utterance>", "<image>"] }) self.image_token_id = processor.tokenizer.additional_special_tokens_ids[ processor.tokenizer.additional_special_tokens.index("<image>") ] def __call__(self, examples): texts = [] images = [] for example in examples: image = example["image"] question = example["question"] answer = example["answer"] messages = [ { "role": "user", "content": [ {"type": "text", "text": question}, {"type": "image"}, ] }, { "role": "assistant", "content": [ {"type": "text", "text": answer} ] } ] text = processor.apply_chat_template(messages, add_generation_prompt=False) texts.append(text.strip()) images.append([image]) batch = processor(text=texts, images=images, return_tensors="pt", padding=True) labels = batch["input_ids"].clone() labels[labels == processor.tokenizer.pad_token_id] = self.image_token_id batch["labels"] = labels return batch ``` How do I fix this?
{ "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/38963/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/38963/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/38962
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38962/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38962/comments
https://api.github.com/repos/huggingface/transformers/issues/38962/events
https://github.com/huggingface/transformers/pull/38962
3,164,901,527
PR_kwDOCUB6oc6bgER4
38,962
Update test_candidate_generator.py
{ "login": "Natakarani", "id": 139905162, "node_id": "U_kgDOCFbIig", "avatar_url": "https://avatars.githubusercontent.com/u/139905162?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Natakarani", "html_url": "https://github.com/Natakarani", "followers_url": "https://api.github.com/users/Natakarani/followers", "following_url": "https://api.github.com/users/Natakarani/following{/other_user}", "gists_url": "https://api.github.com/users/Natakarani/gists{/gist_id}", "starred_url": "https://api.github.com/users/Natakarani/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Natakarani/subscriptions", "organizations_url": "https://api.github.com/users/Natakarani/orgs", "repos_url": "https://api.github.com/users/Natakarani/repos", "events_url": "https://api.github.com/users/Natakarani/events{/privacy}", "received_events_url": "https://api.github.com/users/Natakarani/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-06-21T08:17:11
2025-06-23T12:49:20
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38962", "html_url": "https://github.com/huggingface/transformers/pull/38962", "diff_url": "https://github.com/huggingface/transformers/pull/38962.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38962.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 --> 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, @SunMarc and @qgallouedec - 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/38962/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/38962/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/38961
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38961/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38961/comments
https://api.github.com/repos/huggingface/transformers/issues/38961/events
https://github.com/huggingface/transformers/issues/38961
3,164,862,285
I_kwDOCUB6oc68o_dN
38,961
🛠️ Add Failure-Safe Training with Emergency Checkpointing
{ "login": "yaswanth19", "id": 82788246, "node_id": "MDQ6VXNlcjgyNzg4MjQ2", "avatar_url": "https://avatars.githubusercontent.com/u/82788246?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yaswanth19", "html_url": "https://github.com/yaswanth19", "followers_url": "https://api.github.com/users/yaswanth19/followers", "following_url": "https://api.github.com/users/yaswanth19/following{/other_user}", "gists_url": "https://api.github.com/users/yaswanth19/gists{/gist_id}", "starred_url": "https://api.github.com/users/yaswanth19/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yaswanth19/subscriptions", "organizations_url": "https://api.github.com/users/yaswanth19/orgs", "repos_url": "https://api.github.com/users/yaswanth19/repos", "events_url": "https://api.github.com/users/yaswanth19/events{/privacy}", "received_events_url": "https://api.github.com/users/yaswanth19/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-06-21T07:28:25
2025-06-26T10:38:38
null
CONTRIBUTOR
null
null
null
null
### Feature request Introduce a **failure-safe training mode** in the `Trainer` API (e.g., via a flag like `enable_emergency_checkpoint=True`) that ensures training progress is saved **automatically upon unexpected failure**, such as hardware interruptions, out-of-memory errors, or bugs during training. This allows users to resume from the **last known safe state**, even if a checkpoint hasn't yet been saved via the normal `save_strategy`. ### Motivation Current training rely on: - Periodic checkpoints using steps or epoch - Manual try/except logic for error handling and saving state However, these methods have limitations: - Saving too frequently using steps slows down training due to I/O overhead - Saving only at the end of an epoch (`save_strategy="epoch"`) risks **losing progress if failure occurs mid-epoch** - Manual error handling is fragile and inconsistent between users This can lead to **wasted compute time** and inability to resume training effectively. ### Your contribution N/A CC: @SunMarc
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38961/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/38961/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/38960
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38960/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38960/comments
https://api.github.com/repos/huggingface/transformers/issues/38960/events
https://github.com/huggingface/transformers/pull/38960
3,164,827,157
PR_kwDOCUB6oc6bf07I
38,960
feat: add number token loss implementation
{ "login": "happybear-21", "id": 214071639, "node_id": "U_kgDODMJ5Vw", "avatar_url": "https://avatars.githubusercontent.com/u/214071639?v=4", "gravatar_id": "", "url": "https://api.github.com/users/happybear-21", "html_url": "https://github.com/happybear-21", "followers_url": "https://api.github.com/users/happybear-21/followers", "following_url": "https://api.github.com/users/happybear-21/following{/other_user}", "gists_url": "https://api.github.com/users/happybear-21/gists{/gist_id}", "starred_url": "https://api.github.com/users/happybear-21/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/happybear-21/subscriptions", "organizations_url": "https://api.github.com/users/happybear-21/orgs", "repos_url": "https://api.github.com/users/happybear-21/repos", "events_url": "https://api.github.com/users/happybear-21/events{/privacy}", "received_events_url": "https://api.github.com/users/happybear-21/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-21T06:45:45
2025-06-23T13:10:48
2025-06-23T13:10:48
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38960", "html_url": "https://github.com/huggingface/transformers/pull/38960", "diff_url": "https://github.com/huggingface/transformers/pull/38960.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38960.patch", "merged_at": null }
feat: Add Number Token Loss (NTL) implementation Issue: #38950 Add Number Token Loss (NTL) to improve language model performance on numerical tasks. NTL addresses the fundamental limitation of cross-entropy loss on numerical tokens by incorporating ordinal information into the training objective. Key features: - NTL-WAS: Uses Wasserstein-1 distance between numerical values - NTL-MSE: Uses Mean Squared Error between numerical values - Automatic numerical token detection (integers, floats, number words, ordinals) - Efficient implementation with minimal computational overhead - Caching of token-to-number mappings for performance - Backward compatibility with fallback to standard cross-entropy Implementation includes: - Core NTL functions in src/transformers/loss/number_token_loss.py - Integration with LOSS_MAPPING in loss_utils.py - Comprehensive test suite in tests/test_number_token_loss.py - Working example in examples/number_token_loss_example.py The loss is designed to augment cross-entropy for tasks involving numerical reasoning, mathematical operations, and any scenario where token ordering matters for numerical values. Resolves the issue where predicting "6" vs "9" for target "5" yields the same cross-entropy loss, despite "6" being numerically closer.
{ "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/38960/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/38960/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38959
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38959/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38959/comments
https://api.github.com/repos/huggingface/transformers/issues/38959/events
https://github.com/huggingface/transformers/pull/38959
3,164,635,930
PR_kwDOCUB6oc6bfOoA
38,959
Updated the model card for wav2vec2-phoneme
{ "login": "AshAnand34", "id": 84689683, "node_id": "MDQ6VXNlcjg0Njg5Njgz", "avatar_url": "https://avatars.githubusercontent.com/u/84689683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AshAnand34", "html_url": "https://github.com/AshAnand34", "followers_url": "https://api.github.com/users/AshAnand34/followers", "following_url": "https://api.github.com/users/AshAnand34/following{/other_user}", "gists_url": "https://api.github.com/users/AshAnand34/gists{/gist_id}", "starred_url": "https://api.github.com/users/AshAnand34/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AshAnand34/subscriptions", "organizations_url": "https://api.github.com/users/AshAnand34/orgs", "repos_url": "https://api.github.com/users/AshAnand34/repos", "events_url": "https://api.github.com/users/AshAnand34/events{/privacy}", "received_events_url": "https://api.github.com/users/AshAnand34/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-06-21T01:26:22
2025-07-03T16:47:29
null
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38959", "html_url": "https://github.com/huggingface/transformers/pull/38959", "diff_url": "https://github.com/huggingface/transformers/pull/38959.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38959.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. --> This pull request updates the documentation for the `Wav2Vec2Phoneme` model to improve readability, provide more examples, and clarify its usage. The changes include a revamped introduction, added usage examples, and detailed explanations of the model's features and capabilities. ### Documentation Enhancements: * **Introduction and Overview**: Replaced the plain text introduction with a visually appealing layout that includes badges for supported frameworks (PyTorch, TensorFlow, Flax) and a clear explanation of the `Wav2Vec2Phoneme` model's purpose and capabilities. Added links to relevant papers and model checkpoints. * **Usage Examples**: Introduced two detailed code examples for phoneme recognition using the `Pipeline` and `AutoModel` classes. These examples demonstrate how to load the model, process audio data, and decode phonemes. * **Quantization Support**: Added a section on quantization, including an example of using `bitsandbytes` to load the model with 8-bit precision, reducing memory usage. ### Detailed Feature Descriptions: * **Model Features**: Expanded on the model's architecture, cross-lingual capabilities, and performance. Explained its ability to map phonemes across languages and its use of connectionist temporal classification (CTC) for training. (Ff214 <!-- Remove if not applicable --> #36979 ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). ## 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 <!-- 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, @SunMarc and @qgallouedec - 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/38959/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/38959/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/38958
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38958/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38958/comments
https://api.github.com/repos/huggingface/transformers/issues/38958/events
https://github.com/huggingface/transformers/pull/38958
3,164,633,893
PR_kwDOCUB6oc6bfOOU
38,958
Updated model card for wav2vec2-conformer
{ "login": "AshAnand34", "id": 84689683, "node_id": "MDQ6VXNlcjg0Njg5Njgz", "avatar_url": "https://avatars.githubusercontent.com/u/84689683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AshAnand34", "html_url": "https://github.com/AshAnand34", "followers_url": "https://api.github.com/users/AshAnand34/followers", "following_url": "https://api.github.com/users/AshAnand34/following{/other_user}", "gists_url": "https://api.github.com/users/AshAnand34/gists{/gist_id}", "starred_url": "https://api.github.com/users/AshAnand34/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AshAnand34/subscriptions", "organizations_url": "https://api.github.com/users/AshAnand34/orgs", "repos_url": "https://api.github.com/users/AshAnand34/repos", "events_url": "https://api.github.com/users/AshAnand34/events{/privacy}", "received_events_url": "https://api.github.com/users/AshAnand34/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-06-21T01:22:28
2025-07-03T16:47:41
null
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38958", "html_url": "https://github.com/huggingface/transformers/pull/38958", "diff_url": "https://github.com/huggingface/transformers/pull/38958.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38958.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. --> This pull request significantly enhances the documentation for the `Wav2Vec2-Conformer` model by improving its structure, adding usage examples, and providing detailed explanations of its architecture and features. It also introduces quantization support and updates the API reference for better clarity. ### Documentation Enhancements: * Reorganized the `Wav2Vec2-Conformer` documentation to include a more structured overview, detailed usage examples, and tips for applying the model to different tasks. Examples include automatic speech recognition and audio classification using both the `Pipeline` and `AutoModel` classes. * Added a section on quantization, demonstrating how to use `bitsandbytes` for 8-bit model quantization to reduce memory usage. ### Architectural and Feature Details: * Expanded the explanation of the `Wav2Vec2-Conformer` architecture, highlighting its use of Conformer blocks for improved speech recognition performance and its compatibility with Wav2Vec2 workflows. * Included notes on position embedding types, tokenizer compatibility, and performance improvements, along with links to official results and related resources. ### API Reference Updates: * Updated the API reference with detailed sections for `Wav2Vec2ConformerConfig`, `Wav2Vec2ConformerModel`, and other related classes, ensuring a clear <!-- Remove if not applicable --> #36979 ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). ## 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 <!-- 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, @SunMarc and @qgallouedec - 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/38958/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/38958/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/38957
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38957/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38957/comments
https://api.github.com/repos/huggingface/transformers/issues/38957/events
https://github.com/huggingface/transformers/pull/38957
3,164,630,582
PR_kwDOCUB6oc6bfNkT
38,957
Update wav2vec2-bert model card
{ "login": "AshAnand34", "id": 84689683, "node_id": "MDQ6VXNlcjg0Njg5Njgz", "avatar_url": "https://avatars.githubusercontent.com/u/84689683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AshAnand34", "html_url": "https://github.com/AshAnand34", "followers_url": "https://api.github.com/users/AshAnand34/followers", "following_url": "https://api.github.com/users/AshAnand34/following{/other_user}", "gists_url": "https://api.github.com/users/AshAnand34/gists{/gist_id}", "starred_url": "https://api.github.com/users/AshAnand34/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AshAnand34/subscriptions", "organizations_url": "https://api.github.com/users/AshAnand34/orgs", "repos_url": "https://api.github.com/users/AshAnand34/repos", "events_url": "https://api.github.com/users/AshAnand34/events{/privacy}", "received_events_url": "https://api.github.com/users/AshAnand34/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-06-21T01:16:19
2025-07-03T16:46:56
null
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38957", "html_url": "https://github.com/huggingface/transformers/pull/38957", "diff_url": "https://github.com/huggingface/transformers/pull/38957.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38957.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. --> This pull request enhances the documentation for the Wav2Vec2-BERT model by improving its structure, adding usage examples, and providing detailed explanations of its features and configuration options. The changes aim to make the documentation more user-friendly and comprehensive for developers working with this model. ### Documentation Enhancements: * **Introduction and Overview**: - Added a detailed introduction to Wav2Vec2-BERT, highlighting its multilingual capabilities, pre-training dataset, and downstream use cases like ASR and audio classification. * **Usage Examples**: - Included Python code snippets demonstrating how to use the model with the `Pipeline` and `AutoModel` classes for tasks like speech recognition and audio classification. - Added an example of using 8-bit quantization to reduce memory usage with the `bitsandbytes` library. * **Model Architecture and Features**: - Documented key architectural details, including the use of causal depthwise convolutional layers, mel-spectrogram inputs, and Conformer-based adapter networks. - Explained supported position embedding types and their configuration options. * **API Reference Updates**: - Reorganized the API reference section for better readability, converting headings to a consistent format (e.g., `### Wav2Vec2BertConfig`) and maintaining a logical structure for model components. [[1]](diffhunk://#diff-fdae81694197d9e85451917d1e1eb8d1365b005b94b5e93bc4256b358f8732f0R144-R152) [[2]](diffhunk://#diff-fdae81694197d9e85451917d1e1eb8d1365b005b94b5e93bc4256b358f8732f0L71-R182) * **Additional Notes**: - Added sections on training data, fine-tuning requirements, and links to official performance results for further exploration. <!-- Remove if not applicable --> #36979 ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). ## 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 <!-- 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, @SunMarc and @qgallouedec - 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/38957/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/38957/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/38956
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38956/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38956/comments
https://api.github.com/repos/huggingface/transformers/issues/38956/events
https://github.com/huggingface/transformers/pull/38956
3,164,562,062
PR_kwDOCUB6oc6be_SX
38,956
Updating model card for wav2vec2
{ "login": "AshAnand34", "id": 84689683, "node_id": "MDQ6VXNlcjg0Njg5Njgz", "avatar_url": "https://avatars.githubusercontent.com/u/84689683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AshAnand34", "html_url": "https://github.com/AshAnand34", "followers_url": "https://api.github.com/users/AshAnand34/followers", "following_url": "https://api.github.com/users/AshAnand34/following{/other_user}", "gists_url": "https://api.github.com/users/AshAnand34/gists{/gist_id}", "starred_url": "https://api.github.com/users/AshAnand34/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AshAnand34/subscriptions", "organizations_url": "https://api.github.com/users/AshAnand34/orgs", "repos_url": "https://api.github.com/users/AshAnand34/repos", "events_url": "https://api.github.com/users/AshAnand34/events{/privacy}", "received_events_url": "https://api.github.com/users/AshAnand34/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-06-20T23:51:31
2025-07-05T19:57:05
null
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38956", "html_url": "https://github.com/huggingface/transformers/pull/38956", "diff_url": "https://github.com/huggingface/transformers/pull/38956.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38956.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. --> This pull request updates the `wav2vec2` documentation to improve readability, enhance usability with examples, and reorganize the structure for better navigation. Key changes include the addition of usage examples, restructuring of the API reference, and updates to the model overview. ### Documentation Enhancements: * Replaced the abstract with a concise explanation of Wav2Vec2 and added links to Hugging Face Hub for checkpoints and examples. * Added Python code examples demonstrating how to use the Wav2Vec2 model for automatic speech recognition and audio classification. * Included guidance on using Flash Attention 2 for faster inference and quantization techniques for memory optimization. ### Structural Improvements: * Reorganized the API reference section by converting model components (`Wav2Vec2Config`, `Wav2Vec2CTCTokenizer`, etc.) into subsections for better navigation. These changes make the documentation more user-friendly and accessible, especially for developers new to Wav2Vec2. <!-- Remove if not applicable --> #36979 ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). ## 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 <!-- 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, @SunMarc and @qgallouedec - 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/38956/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/38956/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/38955
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38955/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38955/comments
https://api.github.com/repos/huggingface/transformers/issues/38955/events
https://github.com/huggingface/transformers/pull/38955
3,164,523,941
PR_kwDOCUB6oc6be3Oq
38,955
docs: Musicgen melody model card
{ "login": "AshAnand34", "id": 84689683, "node_id": "MDQ6VXNlcjg0Njg5Njgz", "avatar_url": "https://avatars.githubusercontent.com/u/84689683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AshAnand34", "html_url": "https://github.com/AshAnand34", "followers_url": "https://api.github.com/users/AshAnand34/followers", "following_url": "https://api.github.com/users/AshAnand34/following{/other_user}", "gists_url": "https://api.github.com/users/AshAnand34/gists{/gist_id}", "starred_url": "https://api.github.com/users/AshAnand34/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AshAnand34/subscriptions", "organizations_url": "https://api.github.com/users/AshAnand34/orgs", "repos_url": "https://api.github.com/users/AshAnand34/repos", "events_url": "https://api.github.com/users/AshAnand34/events{/privacy}", "received_events_url": "https://api.github.com/users/AshAnand34/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-06-20T23:10:15
2025-07-03T16:45:52
null
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38955", "html_url": "https://github.com/huggingface/transformers/pull/38955", "diff_url": "https://github.com/huggingface/transformers/pull/38955.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38955.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. --> This pull request updates the documentation for the MusicGen Melody model in `docs/source/en/model_doc/musicgen_melody.md`. The changes aim to simplify and enhance the clarity of the documentation by restructuring the content, adding examples, and improving formatting. ### Documentation Improvements #### Overview and Structure * Reorganized the content to provide a concise overview of the MusicGen Melody model, highlighting its key features and differences from the original MusicGen. * Simplified the explanation of the model's architecture, breaking it down into three main components: text encoder, MusicGen Melody decoder, and audio decoder. #### Examples and Usage * Replaced lengthy code snippets with streamlined examples for generating music using text and audio prompts, including text-only and unconditional generation scenarios. * Added detailed examples for using tools like Demucs for melody isolation and quantization techniques for memory optimization. #### Formatting and Accessibility * Introduced a sidebar navigation and collapsible sections for better readability and user experience. * Updated links to external resources and added tooltips for key concepts like quantization and guidance scale. <!-- Remove if not applicable --> #36979 ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). ## 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 <!-- 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, @SunMarc and @qgallouedec - 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/38955/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/38955/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/38954
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38954/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38954/comments
https://api.github.com/repos/huggingface/transformers/issues/38954/events
https://github.com/huggingface/transformers/pull/38954
3,164,520,628
PR_kwDOCUB6oc6be2iC
38,954
Add Hugging Face authentication procedure for IDEs (PyCharm, VS Code,…
{ "login": "marcndo", "id": 178362075, "node_id": "U_kgDOCqGW2w", "avatar_url": "https://avatars.githubusercontent.com/u/178362075?v=4", "gravatar_id": "", "url": "https://api.github.com/users/marcndo", "html_url": "https://github.com/marcndo", "followers_url": "https://api.github.com/users/marcndo/followers", "following_url": "https://api.github.com/users/marcndo/following{/other_user}", "gists_url": "https://api.github.com/users/marcndo/gists{/gist_id}", "starred_url": "https://api.github.com/users/marcndo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/marcndo/subscriptions", "organizations_url": "https://api.github.com/users/marcndo/orgs", "repos_url": "https://api.github.com/users/marcndo/repos", "events_url": "https://api.github.com/users/marcndo/events{/privacy}", "received_events_url": "https://api.github.com/users/marcndo/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-20T23:06:23
2025-06-24T18:48:16
2025-06-24T18:48:16
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38954", "html_url": "https://github.com/huggingface/transformers/pull/38954", "diff_url": "https://github.com/huggingface/transformers/pull/38954.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38954.patch", "merged_at": "2025-06-24T18:48:15" }
… etc.) # What does this PR do? This PR aims to resolve #38918 by guiding users on how to authenticate their Hugging Face accounts using IDEs (PyCharm, VS Code, etc.). <!-- 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. This PR aims to guide users who are using IDEs, rather than notebooks, on how they can authenticate into their Hugging Face accounts. This issue was raised in #38918. 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, @SunMarc and @qgallouedec - 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/38954/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/38954/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38953
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38953/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38953/comments
https://api.github.com/repos/huggingface/transformers/issues/38953/events
https://github.com/huggingface/transformers/pull/38953
3,164,486,486
PR_kwDOCUB6oc6bevTW
38,953
docs: created musicgen model card
{ "login": "AshAnand34", "id": 84689683, "node_id": "MDQ6VXNlcjg0Njg5Njgz", "avatar_url": "https://avatars.githubusercontent.com/u/84689683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AshAnand34", "html_url": "https://github.com/AshAnand34", "followers_url": "https://api.github.com/users/AshAnand34/followers", "following_url": "https://api.github.com/users/AshAnand34/following{/other_user}", "gists_url": "https://api.github.com/users/AshAnand34/gists{/gist_id}", "starred_url": "https://api.github.com/users/AshAnand34/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AshAnand34/subscriptions", "organizations_url": "https://api.github.com/users/AshAnand34/orgs", "repos_url": "https://api.github.com/users/AshAnand34/repos", "events_url": "https://api.github.com/users/AshAnand34/events{/privacy}", "received_events_url": "https://api.github.com/users/AshAnand34/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-20T22:29:55
2025-06-23T13:03:23
2025-06-23T13:03:23
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38953", "html_url": "https://github.com/huggingface/transformers/pull/38953", "diff_url": "https://github.com/huggingface/transformers/pull/38953.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38953.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. --> [Copilot is generating a summary...] <!-- Remove if not applicable --> Fixes #36979 ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). ## 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 <!-- 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, @SunMarc and @qgallouedec - 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/38953/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/38953/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38952
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38952/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38952/comments
https://api.github.com/repos/huggingface/transformers/issues/38952/events
https://github.com/huggingface/transformers/issues/38952
3,164,470,717
I_kwDOCUB6oc68nf29
38,952
Deepspeed HF_HOME Cuda Ops bug on transformers==4.51.0 (fixed in >=4.52.0)
{ "login": "Alex-ley-scrub", "id": 94057608, "node_id": "U_kgDOBZs0iA", "avatar_url": "https://avatars.githubusercontent.com/u/94057608?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Alex-ley-scrub", "html_url": "https://github.com/Alex-ley-scrub", "followers_url": "https://api.github.com/users/Alex-ley-scrub/followers", "following_url": "https://api.github.com/users/Alex-ley-scrub/following{/other_user}", "gists_url": "https://api.github.com/users/Alex-ley-scrub/gists{/gist_id}", "starred_url": "https://api.github.com/users/Alex-ley-scrub/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Alex-ley-scrub/subscriptions", "organizations_url": "https://api.github.com/users/Alex-ley-scrub/orgs", "repos_url": "https://api.github.com/users/Alex-ley-scrub/repos", "events_url": "https://api.github.com/users/Alex-ley-scrub/events{/privacy}", "received_events_url": "https://api.github.com/users/Alex-ley-scrub/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-06-20T22:15:39
2025-06-23T13:15:31
2025-06-23T13:15:31
NONE
null
null
null
null
### System Info you may already know this, but I couldn't find the issue anywhere on your GitHub issues, nor Deepspeed's. The fix is pretty easy, just upgrade the transformers version. But thought it might be worth adding an issue here so someone else finds a fix faster then I did when they start googling. ``` uv pip install tokenizers=0.21.0 transformers==4.51.0 python some_script_that_uses_cuda.py from transformers import ( ...<4 lines>... ) File "<frozen importlib._bootstrap>", line 1412, in _handle_fromlist File "/home/alex/miniconda3/envs/py313/lib/python3.13/site-packages/transformers/utils/import_utils.py", line 1955, in __getattr__ module = self._get_module(self._class_to_module[name]) File "/home/alex/miniconda3/envs/py313/lib/python3.13/site-packages/transformers/utils/import_utils.py", line 1969, in _get_module raise RuntimeError( ...<2 lines>... ) from e RuntimeError: Failed to import transformers.modeling_utils because of the following error (look up to see its traceback): CUDA_HOME does not exist, unable to compile CUDA op(s) ``` <img width="748" alt="Image" src="https://github.com/user-attachments/assets/33fa194a-6714-4b44-b294-0dca555b341c" /> to fix it: ``` uv pip install tokenizers=0.21.0 transformers==4.52.0 # although 4.52.0 is yanked so maybe better 4.52.1 python some_script_that_uses_cuda.py ``` ### Who can help? _No response_ ### 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 probably not very important given the fix is very easy - but can give a minimal example if helpful ### Expected behavior not to have this error as happens on lower and higher versions of transformers
{ "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/38952/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/38952/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/38951
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38951/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38951/comments
https://api.github.com/repos/huggingface/transformers/issues/38951/events
https://github.com/huggingface/transformers/pull/38951
3,164,432,645
PR_kwDOCUB6oc6bejq6
38,951
[docs] Retry failed VitPose docs
{ "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 }
[]
closed
false
null
[]
null
[]
2025-06-20T21:46:58
2025-06-20T22:44:31
2025-06-20T22:44:31
MEMBER
null
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38951", "html_url": "https://github.com/huggingface/transformers/pull/38951", "diff_url": "https://github.com/huggingface/transformers/pull/38951.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38951.patch", "merged_at": null }
Fresh start on failing VitPose docs
{ "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/38951/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/38951/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38950
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38950/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38950/comments
https://api.github.com/repos/huggingface/transformers/issues/38950/events
https://github.com/huggingface/transformers/issues/38950
3,164,350,634
I_kwDOCUB6oc68nCiq
38,950
Number Token Loss
{ "login": "jannisborn", "id": 15703818, "node_id": "MDQ6VXNlcjE1NzAzODE4", "avatar_url": "https://avatars.githubusercontent.com/u/15703818?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jannisborn", "html_url": "https://github.com/jannisborn", "followers_url": "https://api.github.com/users/jannisborn/followers", "following_url": "https://api.github.com/users/jannisborn/following{/other_user}", "gists_url": "https://api.github.com/users/jannisborn/gists{/gist_id}", "starred_url": "https://api.github.com/users/jannisborn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jannisborn/subscriptions", "organizations_url": "https://api.github.com/users/jannisborn/orgs", "repos_url": "https://api.github.com/users/jannisborn/repos", "events_url": "https://api.github.com/users/jannisborn/events{/privacy}", "received_events_url": "https://api.github.com/users/jannisborn/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-06-20T20:50:19
2025-06-23T13:00:31
null
CONTRIBUTOR
null
null
null
null
### Feature request **Summary:** We suggest to integrate a novel loss, called **Number Token Loss**, to appear at [ICML 2025](https://ibm.biz/ntl-paper). NTL computes a regression-like loss directly on the token level of a LMHead. **Experiments show that CE augmented with NTL forms a significantly better pretraining objective for LLMs than standard CE.** **Details**: NTL improves performance on tasks where the tokens are actually numbers, e.g., math datasets. It is rapid to calculate and intended to augment cross entropy in order to provide a more meaningful loss signal if the label is a numerical token. NTL-WAS minimizes the Wasserstein-1 distance between the *numerical values* of the real and predicted number tokens. In practice, the Wasserstein-1 distance can be calculated extremely efficiently because the label distribution is one-hot. So no need for any approximations (Sinkhorn distance etc). However, the loss class needs a one-time access to the tokenizer in order to extract a map between tokens (strings) and their numerical value (floats). Also note that this loss does not affect any token that is *not* a number. ### Motivation Cross entropy is the ubiquitous objective in LMs. But when LMs are trained on text with numbers (e.g., math tasks) there is a fundamental problem: CE is nominal-scale -- it assumes tokens are unordered. That makes sense for words, but not for numbers. For example, if the true label is “5,” predicting “6” or “9” yields the same loss, see demo below. Next month at ICML, we will present our paper on the [Number Token Loss](https://ibm.biz/ntl-paper) which fixes this. The loss comes in two flavors, NTL-WAS and NTL-MSE. See the demo below. ![Image](https://github.com/user-attachments/assets/97b8a28d-dd51-4e03-a7c1-8ad26a4afda2) For more details see [here](https://www.linkedin.com/feed/update/urn:li:activity:7340864033874472962/) and [here](https://ibm.biz/ntl-main) ### Your contribution We would be happy to work toward the integration of NTL into the library, ideally to be exposed via `LOSS_MAPPING` in `transformers.loss.loss_utils`. Would you be willing to accept such a PR?
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38950/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/38950/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/38949
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38949/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38949/comments
https://api.github.com/repos/huggingface/transformers/issues/38949/events
https://github.com/huggingface/transformers/pull/38949
3,164,262,814
PR_kwDOCUB6oc6bd_RN
38,949
Allow `device_mesh` have multiple dim
{ "login": "S1ro1", "id": 54212263, "node_id": "MDQ6VXNlcjU0MjEyMjYz", "avatar_url": "https://avatars.githubusercontent.com/u/54212263?v=4", "gravatar_id": "", "url": "https://api.github.com/users/S1ro1", "html_url": "https://github.com/S1ro1", "followers_url": "https://api.github.com/users/S1ro1/followers", "following_url": "https://api.github.com/users/S1ro1/following{/other_user}", "gists_url": "https://api.github.com/users/S1ro1/gists{/gist_id}", "starred_url": "https://api.github.com/users/S1ro1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/S1ro1/subscriptions", "organizations_url": "https://api.github.com/users/S1ro1/orgs", "repos_url": "https://api.github.com/users/S1ro1/repos", "events_url": "https://api.github.com/users/S1ro1/events{/privacy}", "received_events_url": "https://api.github.com/users/S1ro1/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-20T20:02:55
2025-07-26T14:01:24
2025-07-23T12:27:36
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38949", "html_url": "https://github.com/huggingface/transformers/pull/38949", "diff_url": "https://github.com/huggingface/transformers/pull/38949.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38949.patch", "merged_at": "2025-07-23T12:27:36" }
Experimental PR for me to just make stuff work on the accelerate side, will follow up with this after.
{ "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/38949/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/38949/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38948
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38948/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38948/comments
https://api.github.com/repos/huggingface/transformers/issues/38948/events
https://github.com/huggingface/transformers/pull/38948
3,164,198,059
PR_kwDOCUB6oc6bdxaP
38,948
[`Attention`] Small fix on output attentions
{ "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-06-20T19:24:29
2025-06-24T12:42:12
2025-06-24T12:42:10
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38948", "html_url": "https://github.com/huggingface/transformers/pull/38948", "diff_url": "https://github.com/huggingface/transformers/pull/38948.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38948.patch", "merged_at": "2025-06-24T12:42:10" }
Currently, anytime a user sets `output_attentions` in the config it errors out when not using eager. However, it should only error if the value is actually invalid (ie `True`). cc @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/38948/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/38948/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38947
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38947/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38947/comments
https://api.github.com/repos/huggingface/transformers/issues/38947/events
https://github.com/huggingface/transformers/pull/38947
3,163,760,959
PR_kwDOCUB6oc6bcSM_
38,947
:rotating_light: Totally rewrite how pipelines load preprocessors
{ "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-06-20T15:52:10
2025-07-14T15:40:22
2025-07-14T15:40:04
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38947", "html_url": "https://github.com/huggingface/transformers/pull/38947", "diff_url": "https://github.com/huggingface/transformers/pull/38947.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38947.patch", "merged_at": "2025-07-14T15:40:04" }
Pipelines load preprocessors in a very hacky way, by checking various mappings. This creates a lot of weird side-effects, such as models needing to be added to tokenizer mapping lists or else [they can't be used in pipelines](https://github.com/huggingface/transformers/pull/38802). This PR overhauls everything. Every pipeline has attributes `_load_processor`, `_load_image_processor`, `_load_feature_extractor` and `_load_tokenizer`. These are set on the base `Pipeline` class and should be overridden by all subclasses. They have the following possible values: - `True` (this preprocessor must be loaded, always try to load it and throw an error if we fail) - `False` (this preprocessor is not used by the pipeline, don't try to load it) - `None` (this preprocessor is optional, try to load it but continue even if loading fails) This lets us delete a lot of mappings and simplify things!
{ "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/38947/reactions", "total_count": 3, "+1": 0, "-1": 0, "laugh": 0, "hooray": 3, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/38947/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38946
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38946/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38946/comments
https://api.github.com/repos/huggingface/transformers/issues/38946/events
https://github.com/huggingface/transformers/pull/38946
3,163,721,177
PR_kwDOCUB6oc6bcJwS
38,946
Internvl fix
{ "login": "remi-or", "id": 83456801, "node_id": "MDQ6VXNlcjgzNDU2ODAx", "avatar_url": "https://avatars.githubusercontent.com/u/83456801?v=4", "gravatar_id": "", "url": "https://api.github.com/users/remi-or", "html_url": "https://github.com/remi-or", "followers_url": "https://api.github.com/users/remi-or/followers", "following_url": "https://api.github.com/users/remi-or/following{/other_user}", "gists_url": "https://api.github.com/users/remi-or/gists{/gist_id}", "starred_url": "https://api.github.com/users/remi-or/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/remi-or/subscriptions", "organizations_url": "https://api.github.com/users/remi-or/orgs", "repos_url": "https://api.github.com/users/remi-or/repos", "events_url": "https://api.github.com/users/remi-or/events{/privacy}", "received_events_url": "https://api.github.com/users/remi-or/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-20T15:35:00
2025-06-26T16:59:49
2025-06-26T11:45:00
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38946", "html_url": "https://github.com/huggingface/transformers/pull/38946", "diff_url": "https://github.com/huggingface/transformers/pull/38946.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38946.patch", "merged_at": "2025-06-26T11:45:00" }
This PR brings to main a fix that was added in `amd-hf-ci-branch` here: https://github.com/huggingface/transformers/pull/38540 The fix aims to correct a failure of `torch.compile` when compiling a torchvision `resize` function with an uint8 input. The failing tests were: ``` tests/models/internvl/test_video_processor_internvl.py::test_can_compile_fast_video_processor tests/models/qwen2_vl/test_video_processing_qwen2_vl.py::test_can_compile_fast_video_processor ``` This PR also add some Expectations for AMD machines.
{ "login": "remi-or", "id": 83456801, "node_id": "MDQ6VXNlcjgzNDU2ODAx", "avatar_url": "https://avatars.githubusercontent.com/u/83456801?v=4", "gravatar_id": "", "url": "https://api.github.com/users/remi-or", "html_url": "https://github.com/remi-or", "followers_url": "https://api.github.com/users/remi-or/followers", "following_url": "https://api.github.com/users/remi-or/following{/other_user}", "gists_url": "https://api.github.com/users/remi-or/gists{/gist_id}", "starred_url": "https://api.github.com/users/remi-or/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/remi-or/subscriptions", "organizations_url": "https://api.github.com/users/remi-or/orgs", "repos_url": "https://api.github.com/users/remi-or/repos", "events_url": "https://api.github.com/users/remi-or/events{/privacy}", "received_events_url": "https://api.github.com/users/remi-or/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38946/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/38946/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38945
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38945/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38945/comments
https://api.github.com/repos/huggingface/transformers/issues/38945/events
https://github.com/huggingface/transformers/pull/38945
3,163,662,277
PR_kwDOCUB6oc6bb8uf
38,945
Correctly raise error for awq 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 }
[]
closed
false
null
[]
null
[]
2025-06-20T15:12:59
2025-06-20T15:26:21
2025-06-20T15:18:06
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38945", "html_url": "https://github.com/huggingface/transformers/pull/38945", "diff_url": "https://github.com/huggingface/transformers/pull/38945.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38945.patch", "merged_at": "2025-06-20T15:18:06" }
# What does this PR do? Without it, the following would run correctly: ```python from transformers import AutoModelForCausalLM import torch model_id = "hugging-quants/Meta-Llama-3.1-8B-Instruct-AWQ-INT4" model = AutoModelForCausalLM.from_pretrained(model_id, device_map="cpu", torch_dtype=torch.bfloat16) ``` and crash later during forward, whereas it should actually fail early cc @MekkCyber @SunMarc for viz
{ "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/38945/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/38945/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38944
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38944/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38944/comments
https://api.github.com/repos/huggingface/transformers/issues/38944/events
https://github.com/huggingface/transformers/pull/38944
3,163,644,950
PR_kwDOCUB6oc6bb456
38,944
[tests] remove TF tests (uses of `require_tf`)
{ "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-06-20T15:07:02
2025-06-25T17:29:11
2025-06-25T17:29:10
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38944", "html_url": "https://github.com/huggingface/transformers/pull/38944", "diff_url": "https://github.com/huggingface/transformers/pull/38944.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38944.patch", "merged_at": "2025-06-25T17:29:10" }
# What does this PR do? Follow-up to #38758 This PR removes TF tests with the `require_tf` decorator. All uses of `require_tf` were removed, and a deprecation message was added to this test-related function. (If this PR is approved, I'll open similar PRs for other related decorators, such as `require_flax`)
{ "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/38944/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/38944/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38943
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38943/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38943/comments
https://api.github.com/repos/huggingface/transformers/issues/38943/events
https://github.com/huggingface/transformers/pull/38943
3,163,552,277
PR_kwDOCUB6oc6bbkNv
38,943
Break tie in Expectations and gemma3 fixes
{ "login": "remi-or", "id": 83456801, "node_id": "MDQ6VXNlcjgzNDU2ODAx", "avatar_url": "https://avatars.githubusercontent.com/u/83456801?v=4", "gravatar_id": "", "url": "https://api.github.com/users/remi-or", "html_url": "https://github.com/remi-or", "followers_url": "https://api.github.com/users/remi-or/followers", "following_url": "https://api.github.com/users/remi-or/following{/other_user}", "gists_url": "https://api.github.com/users/remi-or/gists{/gist_id}", "starred_url": "https://api.github.com/users/remi-or/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/remi-or/subscriptions", "organizations_url": "https://api.github.com/users/remi-or/orgs", "repos_url": "https://api.github.com/users/remi-or/repos", "events_url": "https://api.github.com/users/remi-or/events{/privacy}", "received_events_url": "https://api.github.com/users/remi-or/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-20T14:36:45
2025-06-23T13:13:28
2025-06-23T13:13:28
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38943", "html_url": "https://github.com/huggingface/transformers/pull/38943", "diff_url": "https://github.com/huggingface/transformers/pull/38943.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38943.patch", "merged_at": "2025-06-23T13:13:28" }
This PR adds a way to break ties between competing expectations with the same score, by taking into account the major and minor version of each candidate. This fixes some tests in `gemma3` that were defaulting to cuda 7 instead of cuda 8, which is in an issue when cuda 7 Expectations isan empty list. Some test were not fixed by this, and I added further expectations to them.
{ "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/38943/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/38943/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38942
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38942/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38942/comments
https://api.github.com/repos/huggingface/transformers/issues/38942/events
https://github.com/huggingface/transformers/pull/38942
3,163,498,869
PR_kwDOCUB6oc6bbYdX
38,942
Decouple device_map='auto' and tp_plan='auto'
{ "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-06-20T14:18:05
2025-07-03T09:07:18
2025-07-03T09:07:12
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38942", "html_url": "https://github.com/huggingface/transformers/pull/38942", "diff_url": "https://github.com/huggingface/transformers/pull/38942.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38942.patch", "merged_at": "2025-07-03T09:07:12" }
# What does this PR do? Fixes https://github.com/huggingface/transformers/issues/38771. This PR decouples device_map='auto' and tp_plan='auto'. Before, launching a distributed run when the `device_map` was set to "auto" triggered TP. We removed that and the user should instead pass tp_plan="auto" or tp_size to tigger TP. Also, we warn/info that this might lead to an unexpected behavior with someone tries to run a distributed run with device_map = "auto".
{ "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/38942/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/38942/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38941
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38941/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38941/comments
https://api.github.com/repos/huggingface/transformers/issues/38941/events
https://github.com/huggingface/transformers/pull/38941
3,163,019,646
PR_kwDOCUB6oc6bZuVz
38,941
Pin PyTorch extras for AMD containers
{ "login": "ahadnagy", "id": 21314428, "node_id": "MDQ6VXNlcjIxMzE0NDI4", "avatar_url": "https://avatars.githubusercontent.com/u/21314428?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ahadnagy", "html_url": "https://github.com/ahadnagy", "followers_url": "https://api.github.com/users/ahadnagy/followers", "following_url": "https://api.github.com/users/ahadnagy/following{/other_user}", "gists_url": "https://api.github.com/users/ahadnagy/gists{/gist_id}", "starred_url": "https://api.github.com/users/ahadnagy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ahadnagy/subscriptions", "organizations_url": "https://api.github.com/users/ahadnagy/orgs", "repos_url": "https://api.github.com/users/ahadnagy/repos", "events_url": "https://api.github.com/users/ahadnagy/events{/privacy}", "received_events_url": "https://api.github.com/users/ahadnagy/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-20T11:41:33
2025-06-20T12:17:21
2025-06-20T12:17:21
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38941", "html_url": "https://github.com/huggingface/transformers/pull/38941", "diff_url": "https://github.com/huggingface/transformers/pull/38941.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38941.patch", "merged_at": "2025-06-20T12:17:21" }
# What does this PR do? This PR pins the PyTorch version for the built Docker containers to 2.6.0. The reason behind this is that the ROCm version of PyTorch 2.7.1 is not available to date and the vanilla install replaces it with the 2.7.1 Nvidia version. This should be a temporary fix until 2.7.1 is released for ROCm 6.4. (The base image also has 2.6.0 installed, which we'd like to move away from as soon as possible to a non-PyTorch image.) ## 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, @SunMarc and @qgallouedec - 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/38941/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/38941/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38940
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38940/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38940/comments
https://api.github.com/repos/huggingface/transformers/issues/38940/events
https://github.com/huggingface/transformers/pull/38940
3,162,891,328
PR_kwDOCUB6oc6bZRcM
38,940
Remove script datasets in tests
{ "login": "lhoestq", "id": 42851186, "node_id": "MDQ6VXNlcjQyODUxMTg2", "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lhoestq", "html_url": "https://github.com/lhoestq", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "repos_url": "https://api.github.com/users/lhoestq/repos", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-20T11:00:04
2025-06-26T08:02:52
2025-06-25T14:31:20
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38940", "html_url": "https://github.com/huggingface/transformers/pull/38940", "diff_url": "https://github.com/huggingface/transformers/pull/38940.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38940.patch", "merged_at": "2025-06-25T14:31:20" }
...and remove the tests that were skipped in https://github.com/huggingface/transformers/pull/38931
{ "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/38940/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/38940/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38939
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38939/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38939/comments
https://api.github.com/repos/huggingface/transformers/issues/38939/events
https://github.com/huggingface/transformers/issues/38939
3,162,738,936
I_kwDOCUB6oc68g5D4
38,939
Resuming training from an interrupted checkpoint fails to save the final checkpoint.
{ "login": "rangehow", "id": 88258534, "node_id": "MDQ6VXNlcjg4MjU4NTM0", "avatar_url": "https://avatars.githubusercontent.com/u/88258534?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rangehow", "html_url": "https://github.com/rangehow", "followers_url": "https://api.github.com/users/rangehow/followers", "following_url": "https://api.github.com/users/rangehow/following{/other_user}", "gists_url": "https://api.github.com/users/rangehow/gists{/gist_id}", "starred_url": "https://api.github.com/users/rangehow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rangehow/subscriptions", "organizations_url": "https://api.github.com/users/rangehow/orgs", "repos_url": "https://api.github.com/users/rangehow/repos", "events_url": "https://api.github.com/users/rangehow/events{/privacy}", "received_events_url": "https://api.github.com/users/rangehow/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-06-20T10:18:06
2025-09-18T09:57:22
2025-09-18T09:57:22
CONTRIBUTOR
null
null
null
null
### System Info - `transformers` version: 4.53.0.dev0 - Platform: Linux-4.18.0-147.mt20200626.413.el8_1.x86_64-x86_64-with-glibc2.17 - 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: 0.16.7 - PyTorch version (accelerator?): 2.6.0+cu124 (NA) - 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 ### 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 Normally, a trainer that saves checkpoints based on steps or epochs is guaranteed to save a final checkpoint upon completion of the training. This is ensured by the following sequence of logic: First, when the training reaches the final step, do_sync_step is set to True based on the second part of this conditional statement. https://github.com/huggingface/transformers/blob/0725cd6953803b8aacfc85288cbfb83dea30c469/src/transformers/trainer.py#L2508 This flag indicates that a gradient update is about to be performed, and the global_step is updated precisely within that gradient update branch. (see L2623) https://github.com/huggingface/transformers/blob/0725cd6953803b8aacfc85288cbfb83dea30c469/src/transformers/trainer.py#L2569-L2635 This coherent logic would work without any issues in an error-free training run. However, when training is resumed, the step counter is not restored; it is still initialized from -1. https://github.com/huggingface/transformers/blob/0725cd6953803b8aacfc85288cbfb83dea30c469/src/transformers/trainer.py#L2492 This prevents a gradient update for the final set of batches in an epoch if the total dataset size is not perfectly divisible by the product of gradient_accumulation_steps and the data-parallel world size.
{ "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/38939/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/38939/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/38938
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38938/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38938/comments
https://api.github.com/repos/huggingface/transformers/issues/38938/events
https://github.com/huggingface/transformers/pull/38938
3,162,671,480
PR_kwDOCUB6oc6bYgDq
38,938
fix bug when using DP in trl, the batch size of input and output dism…
{ "login": "kaixuanliu", "id": 13268042, "node_id": "MDQ6VXNlcjEzMjY4MDQy", "avatar_url": "https://avatars.githubusercontent.com/u/13268042?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kaixuanliu", "html_url": "https://github.com/kaixuanliu", "followers_url": "https://api.github.com/users/kaixuanliu/followers", "following_url": "https://api.github.com/users/kaixuanliu/following{/other_user}", "gists_url": "https://api.github.com/users/kaixuanliu/gists{/gist_id}", "starred_url": "https://api.github.com/users/kaixuanliu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kaixuanliu/subscriptions", "organizations_url": "https://api.github.com/users/kaixuanliu/orgs", "repos_url": "https://api.github.com/users/kaixuanliu/repos", "events_url": "https://api.github.com/users/kaixuanliu/events{/privacy}", "received_events_url": "https://api.github.com/users/kaixuanliu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-20T09:58:55
2025-09-03T01:15:19
2025-09-03T01:15:19
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38938", "html_url": "https://github.com/huggingface/transformers/pull/38938", "diff_url": "https://github.com/huggingface/transformers/pull/38938.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38938.patch", "merged_at": null }
null
{ "login": "kaixuanliu", "id": 13268042, "node_id": "MDQ6VXNlcjEzMjY4MDQy", "avatar_url": "https://avatars.githubusercontent.com/u/13268042?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kaixuanliu", "html_url": "https://github.com/kaixuanliu", "followers_url": "https://api.github.com/users/kaixuanliu/followers", "following_url": "https://api.github.com/users/kaixuanliu/following{/other_user}", "gists_url": "https://api.github.com/users/kaixuanliu/gists{/gist_id}", "starred_url": "https://api.github.com/users/kaixuanliu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kaixuanliu/subscriptions", "organizations_url": "https://api.github.com/users/kaixuanliu/orgs", "repos_url": "https://api.github.com/users/kaixuanliu/repos", "events_url": "https://api.github.com/users/kaixuanliu/events{/privacy}", "received_events_url": "https://api.github.com/users/kaixuanliu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38938/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/38938/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38937
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38937/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38937/comments
https://api.github.com/repos/huggingface/transformers/issues/38937/events
https://github.com/huggingface/transformers/pull/38937
3,162,561,113
PR_kwDOCUB6oc6bYG_C
38,937
docs: fix typo when registering model by AutoClass in custom_models.md
{ "login": "chaokunyang", "id": 12445254, "node_id": "MDQ6VXNlcjEyNDQ1MjU0", "avatar_url": "https://avatars.githubusercontent.com/u/12445254?v=4", "gravatar_id": "", "url": "https://api.github.com/users/chaokunyang", "html_url": "https://github.com/chaokunyang", "followers_url": "https://api.github.com/users/chaokunyang/followers", "following_url": "https://api.github.com/users/chaokunyang/following{/other_user}", "gists_url": "https://api.github.com/users/chaokunyang/gists{/gist_id}", "starred_url": "https://api.github.com/users/chaokunyang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chaokunyang/subscriptions", "organizations_url": "https://api.github.com/users/chaokunyang/orgs", "repos_url": "https://api.github.com/users/chaokunyang/repos", "events_url": "https://api.github.com/users/chaokunyang/events{/privacy}", "received_events_url": "https://api.github.com/users/chaokunyang/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-06-20T09:30:09
2025-06-20T09:31:50
2025-06-20T09:31:50
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38937", "html_url": "https://github.com/huggingface/transformers/pull/38937", "diff_url": "https://github.com/huggingface/transformers/pull/38937.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38937.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 --> 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, @SunMarc and @qgallouedec - 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": "chaokunyang", "id": 12445254, "node_id": "MDQ6VXNlcjEyNDQ1MjU0", "avatar_url": "https://avatars.githubusercontent.com/u/12445254?v=4", "gravatar_id": "", "url": "https://api.github.com/users/chaokunyang", "html_url": "https://github.com/chaokunyang", "followers_url": "https://api.github.com/users/chaokunyang/followers", "following_url": "https://api.github.com/users/chaokunyang/following{/other_user}", "gists_url": "https://api.github.com/users/chaokunyang/gists{/gist_id}", "starred_url": "https://api.github.com/users/chaokunyang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chaokunyang/subscriptions", "organizations_url": "https://api.github.com/users/chaokunyang/orgs", "repos_url": "https://api.github.com/users/chaokunyang/repos", "events_url": "https://api.github.com/users/chaokunyang/events{/privacy}", "received_events_url": "https://api.github.com/users/chaokunyang/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38937/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/38937/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38936
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38936/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38936/comments
https://api.github.com/repos/huggingface/transformers/issues/38936/events
https://github.com/huggingface/transformers/pull/38936
3,162,546,206
PR_kwDOCUB6oc6bYDnB
38,936
Switch to use A10 progressively
{ "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-06-20T09:26:09
2025-06-20T16:10:36
2025-06-20T16:10:35
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/38936", "html_url": "https://github.com/huggingface/transformers/pull/38936", "diff_url": "https://github.com/huggingface/transformers/pull/38936.diff", "patch_url": "https://github.com/huggingface/transformers/pull/38936.patch", "merged_at": "2025-06-20T16:10:35" }
# What does this PR do? I don't want to switch in one go. My goal is to switch those job to use A10 if they have no extra failures on A10 compared to T4. For those have extra failures on A10, I will fix them and switch to A10 progressively. Currently, the data fetched is from https://huggingface.co/datasets/hf-internal-testing/transformers_daily_ci/blob/main/runner_map.json I will trigger manually a run with A10 and fill the model names (that should use T4 runners) to the above file.
{ "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/38936/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/38936/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/38935
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/38935/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/38935/comments
https://api.github.com/repos/huggingface/transformers/issues/38935/events
https://github.com/huggingface/transformers/issues/38935
3,162,540,744
I_kwDOCUB6oc68gIrI
38,935
Gemma2 crash on load with torch <= 2.4
{ "login": "francois-rozet", "id": 37352336, "node_id": "MDQ6VXNlcjM3MzUyMzM2", "avatar_url": "https://avatars.githubusercontent.com/u/37352336?v=4", "gravatar_id": "", "url": "https://api.github.com/users/francois-rozet", "html_url": "https://github.com/francois-rozet", "followers_url": "https://api.github.com/users/francois-rozet/followers", "following_url": "https://api.github.com/users/francois-rozet/following{/other_user}", "gists_url": "https://api.github.com/users/francois-rozet/gists{/gist_id}", "starred_url": "https://api.github.com/users/francois-rozet/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/francois-rozet/subscriptions", "organizations_url": "https://api.github.com/users/francois-rozet/orgs", "repos_url": "https://api.github.com/users/francois-rozet/repos", "events_url": "https://api.github.com/users/francois-rozet/events{/privacy}", "received_events_url": "https://api.github.com/users/francois-rozet/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-06-20T09:24:45
2025-06-27T08:16:10
2025-06-27T08:16:10
NONE
null
null
null
null
### System Info - `transformers` version: 4.52.4 - Platform: Linux-6.1.134.1.fi-x86_64-with-glibc2.28 - Python version: 3.12.5 - Huggingface_hub version: 0.33.0 - Safetensors version: 0.5.3 - Accelerate version: not installed - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (GPU?): 2.4.0+cpu (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?: no ### Who can help? @ArthurZucker ### 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 Gemma2 crashes on load with "older" torch version (2.4). It does not crash with torch 2.5 and 2.7. ```python >>> from transformers import AutoModelForCausalLM >>> AutoModelForCausalLM.from_pretrained("google/gemma-2-2b-it") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/home/frozet/.venvs/transformers/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py", line 571, in from_pretrained return model_class.from_pretrained( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/home/frozet/.venvs/transformers/lib/python3.12/site-packages/transformers/modeling_utils.py", line 309, in _wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/mnt/home/frozet/.venvs/transformers/lib/python3.12/site-packages/transformers/modeling_utils.py", line 4508, in from_pretrained model = cls(config, *model_args, **model_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/home/frozet/.venvs/transformers/lib/python3.12/site-packages/transformers/models/gemma2/modeling_gemma2.py", line 659, in __init__ self.model = Gemma2Model(config) ^^^^^^^^^^^^^^^^^^^ File "/mnt/home/frozet/.venvs/transformers/lib/python3.12/site-packages/transformers/models/gemma2/modeling_gemma2.py", line 429, in __init__ self.post_init() File "/mnt/home/frozet/.venvs/transformers/lib/python3.12/site-packages/transformers/modeling_utils.py", line 1969, in post_init if v not in ALL_PARALLEL_STYLES: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable ``` This issue affects the `diffusers` library (see https://github.com/huggingface/diffusers/issues/11721) ### Expected behavior No crash.
{ "login": "francois-rozet", "id": 37352336, "node_id": "MDQ6VXNlcjM3MzUyMzM2", "avatar_url": "https://avatars.githubusercontent.com/u/37352336?v=4", "gravatar_id": "", "url": "https://api.github.com/users/francois-rozet", "html_url": "https://github.com/francois-rozet", "followers_url": "https://api.github.com/users/francois-rozet/followers", "following_url": "https://api.github.com/users/francois-rozet/following{/other_user}", "gists_url": "https://api.github.com/users/francois-rozet/gists{/gist_id}", "starred_url": "https://api.github.com/users/francois-rozet/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/francois-rozet/subscriptions", "organizations_url": "https://api.github.com/users/francois-rozet/orgs", "repos_url": "https://api.github.com/users/francois-rozet/repos", "events_url": "https://api.github.com/users/francois-rozet/events{/privacy}", "received_events_url": "https://api.github.com/users/francois-rozet/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/38935/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/38935/timeline
null
completed
{ "total": 0, "completed": 0, "percent_completed": 0 }
{ "blocked_by": 0, "total_blocked_by": 0, "blocking": 0, "total_blocking": 0 }
false
true