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/39336
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39336/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39336/comments
https://api.github.com/repos/huggingface/transformers/issues/39336/events
https://github.com/huggingface/transformers/issues/39336
3,219,035,401
I_kwDOCUB6oc6_3pUJ
39,336
TypeError: GenerationMixin._extract_past_from_model_output() got an unexpected keyword argument 'standardize_cache_format'
{ "login": "FurkanGozukara", "id": 19240467, "node_id": "MDQ6VXNlcjE5MjQwNDY3", "avatar_url": "https://avatars.githubusercontent.com/u/19240467?v=4", "gravatar_id": "", "url": "https://api.github.com/users/FurkanGozukara", "html_url": "https://github.com/FurkanGozukara", "followers_url": "https://api.github.com/users/FurkanGozukara/followers", "following_url": "https://api.github.com/users/FurkanGozukara/following{/other_user}", "gists_url": "https://api.github.com/users/FurkanGozukara/gists{/gist_id}", "starred_url": "https://api.github.com/users/FurkanGozukara/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/FurkanGozukara/subscriptions", "organizations_url": "https://api.github.com/users/FurkanGozukara/orgs", "repos_url": "https://api.github.com/users/FurkanGozukara/repos", "events_url": "https://api.github.com/users/FurkanGozukara/events{/privacy}", "received_events_url": "https://api.github.com/users/FurkanGozukara/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-07-10T11:49:02
2025-08-18T08:03:13
2025-08-18T08:03:13
NONE
null
null
null
null
I am using CogVLM2 video captioning model It works latest with transformers==4.43.4 with transformers==4.44.0 and forward I get below error but I need to use latest version of transformers since currently 4bit quantization fails on some gpus and platforms how can i fix this issue? `TypeError: GenerationMixin._extract_past_from_model_output() got an unexpected keyword argument 'standardize_cache_format'` ``` 14:23:32 - INFO - Final video tensor shape for CogVLM processing: torch.Size([3, 24, 720, 1280]) 14:23:35 - ERROR - Error during auto-captioning: GenerationMixin._extract_past_from_model_output() got an unexpected keyword argument 'standardize_cache_format' Traceback (most recent call last): File "E:\Ultimate_Video_Processing_v1\STAR\logic\cogvlm_utils.py", line 679, in auto_caption outputs_tensor = local_model_ref.generate(**inputs_on_device, **gen_kwargs) File "E:\Ultimate_Video_Processing_v1\venv\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) File "E:\Ultimate_Video_Processing_v1\venv\lib\site-packages\transformers\generation\utils.py", line 2024, in generate result = self._sample( File "E:\Ultimate_Video_Processing_v1\venv\lib\site-packages\transformers\generation\utils.py", line 3032, in _sample model_kwargs = self._update_model_kwargs_for_generation( File "E:\Ultimate_Video_Processing_v1\STAR\models\modules\transformers_modules\cogvlm2-video-llama3-chat\modeling_cogvlm.py", line 726, in _update_model_kwargs_for_generation cache_name, cache = self._extract_past_from_model_output( TypeError: GenerationMixin._extract_past_from_model_output() got an unexpected keyword argument 'standardize_cache_format' ``` @amyeroberts, @qubvel @SunMarc @MekkCyber the error i am getting is below with 4.43.1 on B200 when doing 4bit quant. interesting same code same libraries on my rtx 5090 on windows working without errors fp16 has no issues ``` 11:45:10 - INFO - Preparing to load model from: /workspace/STAR/models/cogvlm2-video-llama3-chat with quant: 4, dtype: torch.bfloat16, device: cuda, device_map: auto, low_cpu_mem: True 11:45:10 - INFO - Starting model loading - this operation cannot be interrupted once started /workspace/venv/lib/python3.10/site-packages/torchvision/transforms/_functional_video.py:6: UserWarning: The 'torchvision.transforms._functional_video' module is deprecated since 0.12 and will be removed in the future. Please use the 'torchvision.transforms.functional' module instead. warnings.warn( /workspace/venv/lib/python3.10/site-packages/torchvision/transforms/_transforms_video.py:22: UserWarning: The 'torchvision.transforms._transforms_video' module is deprecated since 0.12 and will be removed in the future. Please use the 'torchvision.transforms' module instead. warnings.warn( Loading checkpoint shards: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 6/6 [01:18<00:00, 13.07s/steps] 11:46:30 - ERROR - Failed to load CogVLM2 model from path: /workspace/STAR/models/cogvlm2-video-llama3-chat 11:46:30 - ERROR - Exception type: ValueError 11:46:30 - ERROR - Exception details: `.to` is not supported for `4-bit` or `8-bit` bitsandbytes models. Please use the model as it is, since the model has already been set to the correct devices and casted to the correct `dtype`. Traceback (most recent call last): File "/workspace/STAR/logic/cogvlm_utils.py", line 160, in load_cogvlm_model raise model_loading_result["error"] File "/workspace/STAR/logic/cogvlm_utils.py", line 122, in load_model_thread model = AutoModelForCausalLM.from_pretrained( File "/workspace/venv/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 559, in from_pretrained return model_class.from_pretrained( File "/workspace/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4000, in from_pretrained dispatch_model(model, **device_map_kwargs) File "/workspace/venv/lib/python3.10/site-packages/accelerate/big_modeling.py", line 502, in dispatch_model model.to(device) File "/workspace/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2849, in to raise ValueError( ValueError: `.to` is not supported for `4-bit` or `8-bit` bitsandbytes models. Please use the model as it is, since the model has already been set to the correct devices and casted to the correct `dtype`. 11:46:30 - ERROR - Error during auto-captioning: 'Could not load CogVLM2 model (check logs for details): `.to` is not supported for `4-bit` or `8-bit` bitsandbytes models. Please use the model as it is, since the model has already been set to the correct devices and casted to the correct `dtype`.' Traceback (most recent call last): File "/workspace/STAR/logic/cogvlm_utils.py", line 160, in load_cogvlm_model raise model_loading_result["error"] File "/workspace/STAR/logic/cogvlm_utils.py", line 122, in load_model_thread model = AutoModelForCausalLM.from_pretrained( File "/workspace/venv/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 559, in from_pretrained return model_class.from_pretrained( File "/workspace/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4000, in from_pretrained dispatch_model(model, **device_map_kwargs) File "/workspace/venv/lib/python3.10/site-packages/accelerate/big_modeling.py", line 502, in dispatch_model model.to(device) File "/workspace/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2849, in to raise ValueError( ValueError: `.to` is not supported for `4-bit` or `8-bit` bitsandbytes models. Please use the model as it is, since the model has already been set to the correct devices and casted to the correct `dtype`. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/workspace/STAR/logic/cogvlm_utils.py", line 478, in auto_caption local_model_ref, local_tokenizer_ref = load_cogvlm_model(quantization, cogvlm_device, cog_vlm_model_path, logger) File "/workspace/STAR/logic/cogvlm_utils.py", line 243, in load_cogvlm_model raise gr.Error(f"Could not load CogVLM2 model (check logs for details): {str(e)[:200]}") gradio.exceptions.Error: 'Could not load CogVLM2 model (check logs for details): `.to` is not supported for `4-bit` or `8-bit` bitsandbytes models. Please use the model as it is, since the model has already been set to the correct devices and casted to the correct `dtype`.' 11:46:30 - INFO - Unloading CogVLM2 model with strategy: full ```
{ "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/39336/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/39336/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/39335
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39335/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39335/comments
https://api.github.com/repos/huggingface/transformers/issues/39335/events
https://github.com/huggingface/transformers/pull/39335
3,218,928,455
PR_kwDOCUB6oc6eSMTy
39,335
[BLIP] remove cache from Qformer
{ "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-07-10T11:15:24
2025-07-14T07:20:02
2025-07-14T07:20:02
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39335", "html_url": "https://github.com/huggingface/transformers/pull/39335", "diff_url": "https://github.com/huggingface/transformers/pull/39335.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39335.patch", "merged_at": "2025-07-14T07:20:02" }
# What does this PR do? Qformer doesn't use cache and is not generative, this PR deprecates it for one version. We'll remove all usage of cache in non-generative models after 4.55 :)
{ "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/39335/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/39335/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39334
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39334/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39334/comments
https://api.github.com/repos/huggingface/transformers/issues/39334/events
https://github.com/huggingface/transformers/issues/39334
3,218,910,250
I_kwDOCUB6oc6_3Kwq
39,334
FlashAttention2 ImportError: undefined symbol with flash_attn_2_cuda when loading Phi-4-Multimodal
{ "login": "tanuj-rai", "id": 84439872, "node_id": "MDQ6VXNlcjg0NDM5ODcy", "avatar_url": "https://avatars.githubusercontent.com/u/84439872?v=4", "gravatar_id": "", "url": "https://api.github.com/users/tanuj-rai", "html_url": "https://github.com/tanuj-rai", "followers_url": "https://api.github.com/users/tanuj-rai/followers", "following_url": "https://api.github.com/users/tanuj-rai/following{/other_user}", "gists_url": "https://api.github.com/users/tanuj-rai/gists{/gist_id}", "starred_url": "https://api.github.com/users/tanuj-rai/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tanuj-rai/subscriptions", "organizations_url": "https://api.github.com/users/tanuj-rai/orgs", "repos_url": "https://api.github.com/users/tanuj-rai/repos", "events_url": "https://api.github.com/users/tanuj-rai/events{/privacy}", "received_events_url": "https://api.github.com/users/tanuj-rai/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-07-10T11:10:35
2025-07-10T12:41:35
2025-07-10T12:41:35
CONTRIBUTOR
null
null
null
null
### System Info Transformers version: 4.53.1 PyTorch version: 2.6.0+cu124 Python version: 3.11.13 CUDA version: 12.4 GPU: Tesla T4 ### Who can help? ``` ImportError Traceback (most recent call last) [/tmp/ipython-input-9-1994488020.py](https://localhost:8080/#) in <cell line: 0>() 2 3 import torch ----> 4 from transformers import AutoModelForCausalLM, AutoProcessor 5 import soundfile as sf 6 10 frames [/usr/local/lib/python3.11/dist-packages/flash_attn/flash_attn_interface.py](https://localhost:8080/#) in <module> 13 from .flash_attn_triton_amd import interface_fa as flash_attn_gpu 14 else: ---> 15 import flash_attn_2_cuda as flash_attn_gpu 16 17 # isort: on ImportError: /usr/local/lib/python3.11/dist-packages/flash_attn_2_cuda.cpython-311-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE ` ### 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 ``` import torch from transformers import AutoProcessor, AutoModelForCausalLM import soundfile as sf model_name = "microsoft/Phi-4-multimodal-instruct" processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype=torch.float16, trust_remote_code=True) audio, sr = sf.read("your_audio.wav") messages = [{ "role": "user", "content": [ {"type": "audio", "array": audio, "sampling_rate": sr}, {"type": "text", "text": "Transcribe the audio."} ], }] inputs = processor.apply_chat_template(messages, tokenize=True, return_tensors="pt").to(model.device) out = model.generate(**inputs, max_new_tokens=200) response = processor.batch_decode(out[:, inputs["input_ids"].shape[1]:], skip_special_tokens=True)[0] print("Model response:", response) ``` ### Expected behavior The code should work without error.
{ "login": "tanuj-rai", "id": 84439872, "node_id": "MDQ6VXNlcjg0NDM5ODcy", "avatar_url": "https://avatars.githubusercontent.com/u/84439872?v=4", "gravatar_id": "", "url": "https://api.github.com/users/tanuj-rai", "html_url": "https://github.com/tanuj-rai", "followers_url": "https://api.github.com/users/tanuj-rai/followers", "following_url": "https://api.github.com/users/tanuj-rai/following{/other_user}", "gists_url": "https://api.github.com/users/tanuj-rai/gists{/gist_id}", "starred_url": "https://api.github.com/users/tanuj-rai/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tanuj-rai/subscriptions", "organizations_url": "https://api.github.com/users/tanuj-rai/orgs", "repos_url": "https://api.github.com/users/tanuj-rai/repos", "events_url": "https://api.github.com/users/tanuj-rai/events{/privacy}", "received_events_url": "https://api.github.com/users/tanuj-rai/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39334/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/39334/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/39333
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39333/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39333/comments
https://api.github.com/repos/huggingface/transformers/issues/39333/events
https://github.com/huggingface/transformers/pull/39333
3,218,731,982
PR_kwDOCUB6oc6eRgO1
39,333
[Qwen2.5-VL] Fix torch.finfo() TypeError for integer attention_mask_tensor
{ "login": "dsnsabari", "id": 46018083, "node_id": "MDQ6VXNlcjQ2MDE4MDgz", "avatar_url": "https://avatars.githubusercontent.com/u/46018083?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dsnsabari", "html_url": "https://github.com/dsnsabari", "followers_url": "https://api.github.com/users/dsnsabari/followers", "following_url": "https://api.github.com/users/dsnsabari/following{/other_user}", "gists_url": "https://api.github.com/users/dsnsabari/gists{/gist_id}", "starred_url": "https://api.github.com/users/dsnsabari/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dsnsabari/subscriptions", "organizations_url": "https://api.github.com/users/dsnsabari/orgs", "repos_url": "https://api.github.com/users/dsnsabari/repos", "events_url": "https://api.github.com/users/dsnsabari/events{/privacy}", "received_events_url": "https://api.github.com/users/dsnsabari/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-10T10:15:20
2025-07-14T07:47:40
2025-07-14T07:47:39
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39333", "html_url": "https://github.com/huggingface/transformers/pull/39333", "diff_url": "https://github.com/huggingface/transformers/pull/39333.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39333.patch", "merged_at": "2025-07-14T07:47:39" }
What does this PR do? This PR fixes a critical TypeError in the Qwen2.5-VL model that occurs when processing attention masks with integer dtypes. The error torch.finfo() requires a floating point input type was preventing model inference when using frameworks like Unsloth. Problem The issue occurs in modeling_qwen2_5_vl.py at line 1292 where torch.finfo() is called on attention mask tensors that may have integer dtypes: pythonattention_mask_tensor = attention_mask_tensor / torch.finfo(attention_mask_tensor.dtype).min Since torch.finfo() only supports floating-point types, this crashes when the attention mask tensor has an integer dtype. Solution Added dtype checking to use the appropriate function: torch.iinfo() for integer dtypes torch.finfo() for floating-point dtypes This maintains backward compatibility while fixing the crash for integer attention masks. Impact βœ… Fixes model crashes during vision inference with Unsloth βœ… Enables support for integer dtype attention masks βœ… Maintains existing functionality for float dtype tensors βœ… No breaking changes to existing code <!-- 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? Additional Testing Details βœ… Tested with integer attention mask dtypes (torch.int32, torch.int64) βœ… Tested with floating-point attention mask dtypes (torch.float16, torch.float32) βœ… Verified compatibility with Unsloth framework βœ… Confirmed no regression in existing Qwen2.5-VL functionality βœ… Added unit tests covering both dtype paths Who can review? @amyeroberts @qubvel - This is a vision model fix for Qwen2.5-VL dtype compatibility Priority: High - This is a blocking issue that prevents model inference in common usage scenarios with Unsloth and other frameworks that may use integer attention masks. Backward Compatibility: βœ… Fully backward compatible - no changes to existing API or behavior for floating-point tensors.
{ "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/39333/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/39333/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39332
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39332/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39332/comments
https://api.github.com/repos/huggingface/transformers/issues/39332/events
https://github.com/huggingface/transformers/pull/39332
3,218,454,375
PR_kwDOCUB6oc6eQjrm
39,332
Remove conditional generation in image-to-text pipelines
{ "login": "jiangwangyi", "id": 39762734, "node_id": "MDQ6VXNlcjM5NzYyNzM0", "avatar_url": "https://avatars.githubusercontent.com/u/39762734?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jiangwangyi", "html_url": "https://github.com/jiangwangyi", "followers_url": "https://api.github.com/users/jiangwangyi/followers", "following_url": "https://api.github.com/users/jiangwangyi/following{/other_user}", "gists_url": "https://api.github.com/users/jiangwangyi/gists{/gist_id}", "starred_url": "https://api.github.com/users/jiangwangyi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jiangwangyi/subscriptions", "organizations_url": "https://api.github.com/users/jiangwangyi/orgs", "repos_url": "https://api.github.com/users/jiangwangyi/repos", "events_url": "https://api.github.com/users/jiangwangyi/events{/privacy}", "received_events_url": "https://api.github.com/users/jiangwangyi/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-10T08:46:34
2025-09-11T07:16:12
2025-09-11T07:16:12
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39332", "html_url": "https://github.com/huggingface/transformers/pull/39332", "diff_url": "https://github.com/huggingface/transformers/pull/39332.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39332.patch", "merged_at": null }
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> This PR removes the conditional generation implementation from `ImageToTextPipeline`. ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface, @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 --> @amyeroberts, @qubvel
{ "login": "jiangwangyi", "id": 39762734, "node_id": "MDQ6VXNlcjM5NzYyNzM0", "avatar_url": "https://avatars.githubusercontent.com/u/39762734?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jiangwangyi", "html_url": "https://github.com/jiangwangyi", "followers_url": "https://api.github.com/users/jiangwangyi/followers", "following_url": "https://api.github.com/users/jiangwangyi/following{/other_user}", "gists_url": "https://api.github.com/users/jiangwangyi/gists{/gist_id}", "starred_url": "https://api.github.com/users/jiangwangyi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jiangwangyi/subscriptions", "organizations_url": "https://api.github.com/users/jiangwangyi/orgs", "repos_url": "https://api.github.com/users/jiangwangyi/repos", "events_url": "https://api.github.com/users/jiangwangyi/events{/privacy}", "received_events_url": "https://api.github.com/users/jiangwangyi/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39332/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/39332/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39331
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39331/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39331/comments
https://api.github.com/repos/huggingface/transformers/issues/39331/events
https://github.com/huggingface/transformers/pull/39331
3,218,422,619
PR_kwDOCUB6oc6eQctW
39,331
Remove conditional generation in ImageToTextPipeline
{ "login": "jiangwangyi", "id": 39762734, "node_id": "MDQ6VXNlcjM5NzYyNzM0", "avatar_url": "https://avatars.githubusercontent.com/u/39762734?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jiangwangyi", "html_url": "https://github.com/jiangwangyi", "followers_url": "https://api.github.com/users/jiangwangyi/followers", "following_url": "https://api.github.com/users/jiangwangyi/following{/other_user}", "gists_url": "https://api.github.com/users/jiangwangyi/gists{/gist_id}", "starred_url": "https://api.github.com/users/jiangwangyi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jiangwangyi/subscriptions", "organizations_url": "https://api.github.com/users/jiangwangyi/orgs", "repos_url": "https://api.github.com/users/jiangwangyi/repos", "events_url": "https://api.github.com/users/jiangwangyi/events{/privacy}", "received_events_url": "https://api.github.com/users/jiangwangyi/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-10T08:35:56
2025-07-10T08:41:23
2025-07-10T08:37:55
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39331", "html_url": "https://github.com/huggingface/transformers/pull/39331", "diff_url": "https://github.com/huggingface/transformers/pull/39331.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39331.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 --> Conditional generation has been implemented in ImageTextToTextPipeline, so remove related contents in ImageToTextPipeline. ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface, @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 --> @amyeroberts @qubvel
{ "login": "jiangwangyi", "id": 39762734, "node_id": "MDQ6VXNlcjM5NzYyNzM0", "avatar_url": "https://avatars.githubusercontent.com/u/39762734?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jiangwangyi", "html_url": "https://github.com/jiangwangyi", "followers_url": "https://api.github.com/users/jiangwangyi/followers", "following_url": "https://api.github.com/users/jiangwangyi/following{/other_user}", "gists_url": "https://api.github.com/users/jiangwangyi/gists{/gist_id}", "starred_url": "https://api.github.com/users/jiangwangyi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jiangwangyi/subscriptions", "organizations_url": "https://api.github.com/users/jiangwangyi/orgs", "repos_url": "https://api.github.com/users/jiangwangyi/repos", "events_url": "https://api.github.com/users/jiangwangyi/events{/privacy}", "received_events_url": "https://api.github.com/users/jiangwangyi/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39331/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/39331/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39330
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39330/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39330/comments
https://api.github.com/repos/huggingface/transformers/issues/39330/events
https://github.com/huggingface/transformers/pull/39330
3,218,336,239
PR_kwDOCUB6oc6eQJ2J
39,330
Remove deprecated audio utils functions
{ "login": "jiangwangyi", "id": 39762734, "node_id": "MDQ6VXNlcjM5NzYyNzM0", "avatar_url": "https://avatars.githubusercontent.com/u/39762734?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jiangwangyi", "html_url": "https://github.com/jiangwangyi", "followers_url": "https://api.github.com/users/jiangwangyi/followers", "following_url": "https://api.github.com/users/jiangwangyi/following{/other_user}", "gists_url": "https://api.github.com/users/jiangwangyi/gists{/gist_id}", "starred_url": "https://api.github.com/users/jiangwangyi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jiangwangyi/subscriptions", "organizations_url": "https://api.github.com/users/jiangwangyi/orgs", "repos_url": "https://api.github.com/users/jiangwangyi/repos", "events_url": "https://api.github.com/users/jiangwangyi/events{/privacy}", "received_events_url": "https://api.github.com/users/jiangwangyi/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-10T08:06:55
2025-07-15T14:03:02
2025-07-15T14:02:25
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39330", "html_url": "https://github.com/huggingface/transformers/pull/39330", "diff_url": "https://github.com/huggingface/transformers/pull/39330.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39330.patch", "merged_at": "2025-07-15T14:02:25" }
# 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 --> Remove deprecated functions in `src/transformers/audio_utils.py`. ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface, @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 --> @ArthurZucker @amyeroberts @qubvel
{ "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/39330/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/39330/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39329
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39329/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39329/comments
https://api.github.com/repos/huggingface/transformers/issues/39329/events
https://github.com/huggingface/transformers/issues/39329
3,218,281,277
I_kwDOCUB6oc6_0xM9
39,329
Adding support for Gemma 3n GGUFs
{ "login": "minhnguyenhoang", "id": 27799472, "node_id": "MDQ6VXNlcjI3Nzk5NDcy", "avatar_url": "https://avatars.githubusercontent.com/u/27799472?v=4", "gravatar_id": "", "url": "https://api.github.com/users/minhnguyenhoang", "html_url": "https://github.com/minhnguyenhoang", "followers_url": "https://api.github.com/users/minhnguyenhoang/followers", "following_url": "https://api.github.com/users/minhnguyenhoang/following{/other_user}", "gists_url": "https://api.github.com/users/minhnguyenhoang/gists{/gist_id}", "starred_url": "https://api.github.com/users/minhnguyenhoang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/minhnguyenhoang/subscriptions", "organizations_url": "https://api.github.com/users/minhnguyenhoang/orgs", "repos_url": "https://api.github.com/users/minhnguyenhoang/repos", "events_url": "https://api.github.com/users/minhnguyenhoang/events{/privacy}", "received_events_url": "https://api.github.com/users/minhnguyenhoang/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-07-10T07:46:49
2025-07-24T09:58:08
null
NONE
null
null
null
null
### Feature request There are now quantised GGUF versions of Gemma 3n models available on Hugging Face (e.g. https://huggingface.co/unsloth/gemma-3n-E2B-it-GGUF). Currently they can be run with other backends, but I'd like to have support for them with the `transformers` library. If I run: ```python from transformers import AutoTokenizer, AutoModelForCausalLM model_id = "unsloth/gemma-3n-E2B-it-GGUF" gguf_file = "gemma-3n-E2B-it-Q4_K_M.gguf" tokenizer = AutoTokenizer.from_pretrained(model_id, gguf_file=gguf_file) model = AutoModelForCausalLM.from_pretrained( model_id, gguf_file=gguf_file, torch_dtype=torch.bfloat16, low_cpu_mem_usage=True) ``` It will return a `ValueError: GGUF model with architecture gemma3n is not supported yet.` Side note: in my real implementation of this code I actually have the model downloaded manually from HF then used. However, the end result should be the same and replicable - the error doesn't suggest that my code has a bug. ### Motivation I want to use the transformers backend to inference with this model, but I also want to use the GGUF models instead of the tensor version. ### Your contribution I have minimal experience in AI/ML in general, but if there are resources/examples on previous works similar to this I'm willing to have a try at submitting a PR.
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39329/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/39329/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/39327
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39327/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39327/comments
https://api.github.com/repos/huggingface/transformers/issues/39327/events
https://github.com/huggingface/transformers/pull/39327
3,217,961,482
PR_kwDOCUB6oc6eO4yD
39,327
Fix `get_relative_import_files` for module import
{ "login": "MayDomine", "id": 57244158, "node_id": "MDQ6VXNlcjU3MjQ0MTU4", "avatar_url": "https://avatars.githubusercontent.com/u/57244158?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MayDomine", "html_url": "https://github.com/MayDomine", "followers_url": "https://api.github.com/users/MayDomine/followers", "following_url": "https://api.github.com/users/MayDomine/following{/other_user}", "gists_url": "https://api.github.com/users/MayDomine/gists{/gist_id}", "starred_url": "https://api.github.com/users/MayDomine/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MayDomine/subscriptions", "organizations_url": "https://api.github.com/users/MayDomine/orgs", "repos_url": "https://api.github.com/users/MayDomine/repos", "events_url": "https://api.github.com/users/MayDomine/events{/privacy}", "received_events_url": "https://api.github.com/users/MayDomine/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-10T05:32:03
2025-07-10T05:48:44
2025-07-10T05:48:44
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39327", "html_url": "https://github.com/huggingface/transformers/pull/39327", "diff_url": "https://github.com/huggingface/transformers/pull/39327.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39327.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) `get_relative_import_files` from dynamic_module_utils.py will crash when the `object_file` is a module instead a python file. This issue will make custom `save_function` for `save_pretrained` function of `PretrainedModel` crash. This PR fix this function to make it possible to handle module import. https://github.com/huggingface/transformers/blob/bc161d5d06ba3b40eaca99ce42734b4f1fecfaa2/src/transformers/dynamic_module_utils.py#L127C2-L135C63 ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface, @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": "MayDomine", "id": 57244158, "node_id": "MDQ6VXNlcjU3MjQ0MTU4", "avatar_url": "https://avatars.githubusercontent.com/u/57244158?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MayDomine", "html_url": "https://github.com/MayDomine", "followers_url": "https://api.github.com/users/MayDomine/followers", "following_url": "https://api.github.com/users/MayDomine/following{/other_user}", "gists_url": "https://api.github.com/users/MayDomine/gists{/gist_id}", "starred_url": "https://api.github.com/users/MayDomine/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MayDomine/subscriptions", "organizations_url": "https://api.github.com/users/MayDomine/orgs", "repos_url": "https://api.github.com/users/MayDomine/repos", "events_url": "https://api.github.com/users/MayDomine/events{/privacy}", "received_events_url": "https://api.github.com/users/MayDomine/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39327/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/39327/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39326
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39326/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39326/comments
https://api.github.com/repos/huggingface/transformers/issues/39326/events
https://github.com/huggingface/transformers/issues/39326
3,217,840,227
I_kwDOCUB6oc6_zFhj
39,326
TypeError in Qwen2_5_VLForConditionalGeneration (torch.finfo misuse)
{ "login": "dsnsabari", "id": 46018083, "node_id": "MDQ6VXNlcjQ2MDE4MDgz", "avatar_url": "https://avatars.githubusercontent.com/u/46018083?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dsnsabari", "html_url": "https://github.com/dsnsabari", "followers_url": "https://api.github.com/users/dsnsabari/followers", "following_url": "https://api.github.com/users/dsnsabari/following{/other_user}", "gists_url": "https://api.github.com/users/dsnsabari/gists{/gist_id}", "starred_url": "https://api.github.com/users/dsnsabari/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dsnsabari/subscriptions", "organizations_url": "https://api.github.com/users/dsnsabari/orgs", "repos_url": "https://api.github.com/users/dsnsabari/repos", "events_url": "https://api.github.com/users/dsnsabari/events{/privacy}", "received_events_url": "https://api.github.com/users/dsnsabari/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-07-10T04:24:55
2025-07-10T04:30:43
2025-07-10T04:30:43
CONTRIBUTOR
null
null
null
null
null
{ "login": "dsnsabari", "id": 46018083, "node_id": "MDQ6VXNlcjQ2MDE4MDgz", "avatar_url": "https://avatars.githubusercontent.com/u/46018083?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dsnsabari", "html_url": "https://github.com/dsnsabari", "followers_url": "https://api.github.com/users/dsnsabari/followers", "following_url": "https://api.github.com/users/dsnsabari/following{/other_user}", "gists_url": "https://api.github.com/users/dsnsabari/gists{/gist_id}", "starred_url": "https://api.github.com/users/dsnsabari/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dsnsabari/subscriptions", "organizations_url": "https://api.github.com/users/dsnsabari/orgs", "repos_url": "https://api.github.com/users/dsnsabari/repos", "events_url": "https://api.github.com/users/dsnsabari/events{/privacy}", "received_events_url": "https://api.github.com/users/dsnsabari/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39326/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/39326/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/39325
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39325/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39325/comments
https://api.github.com/repos/huggingface/transformers/issues/39325/events
https://github.com/huggingface/transformers/pull/39325
3,217,743,737
PR_kwDOCUB6oc6eOJlV
39,325
Avoid registering pytree when using FSDP
{ "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-07-10T03:24:11
2025-07-15T07:15:19
2025-07-15T07:15:18
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39325", "html_url": "https://github.com/huggingface/transformers/pull/39325", "diff_url": "https://github.com/huggingface/transformers/pull/39325.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39325.patch", "merged_at": null }
When using FSDP, this `register_pytree_node` operation will cost lots of extra memory. We found after this PR: https://github.com/huggingface/transformers/pull/35873, we cannot finetune 70b model using FSDP due to OOM issue.
{ "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/39325/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/39325/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39324
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39324/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39324/comments
https://api.github.com/repos/huggingface/transformers/issues/39324/events
https://github.com/huggingface/transformers/pull/39324
3,217,545,538
PR_kwDOCUB6oc6eNf8e
39,324
[Bugfix] [Quantization] Remove unused init arg
{ "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-07-10T01:06:19
2025-07-16T12:57:42
2025-07-16T12:57:42
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39324", "html_url": "https://github.com/huggingface/transformers/pull/39324", "diff_url": "https://github.com/huggingface/transformers/pull/39324.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39324.patch", "merged_at": "2025-07-16T12:57:42" }
## Purpose ## * Remove argument which is not used by the CompressedTensors QuantizationConfig * https://github.com/neuralmagic/compressed-tensors/blob/main/src/compressed_tensors/quantization/quant_config.py#L138-L144 ## Changes ## * Remove `run_compressed` from list of QuantizationConfig init kwargs
{ "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/39324/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/39324/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39323
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39323/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39323/comments
https://api.github.com/repos/huggingface/transformers/issues/39323/events
https://github.com/huggingface/transformers/pull/39323
3,217,510,610
PR_kwDOCUB6oc6eNYu9
39,323
Update Readme to Run Multiple Choice Script from Example Directory
{ "login": "eromomon", "id": 110577233, "node_id": "U_kgDOBpdGUQ", "avatar_url": "https://avatars.githubusercontent.com/u/110577233?v=4", "gravatar_id": "", "url": "https://api.github.com/users/eromomon", "html_url": "https://github.com/eromomon", "followers_url": "https://api.github.com/users/eromomon/followers", "following_url": "https://api.github.com/users/eromomon/following{/other_user}", "gists_url": "https://api.github.com/users/eromomon/gists{/gist_id}", "starred_url": "https://api.github.com/users/eromomon/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eromomon/subscriptions", "organizations_url": "https://api.github.com/users/eromomon/orgs", "repos_url": "https://api.github.com/users/eromomon/repos", "events_url": "https://api.github.com/users/eromomon/events{/privacy}", "received_events_url": "https://api.github.com/users/eromomon/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-10T00:40:16
2025-07-11T17:58:26
2025-07-11T17:58:26
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39323", "html_url": "https://github.com/huggingface/transformers/pull/39323", "diff_url": "https://github.com/huggingface/transformers/pull/39323.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39323.patch", "merged_at": "2025-07-11T17:58:26" }
# What does this PR do? In the Multiple Choice example, the Readme file includes the instruction ```bash python examples/pytorch/multiple-choice/run_swag.py \ --model_name_or_path FacebookAI/roberta-base \ --do_train \ --do_eval \ --learning_rate 5e-5 \ --num_train_epochs 3 \ --output_dir /tmp/swag_base \ --per_device_eval_batch_size=16 \ --per_device_train_batch_size=16 \ --overwrite_output ``` which may cause an error when attempting to find the file if the user is currently in the example directory. Assuming the user is in the example directory, this PR suggests removing the complete path and running the Python script directly from that location. Other instructions in this Readme, as well as in other examples, run the script from their respective directories without using the complete path ( examples/DIR_EXAMPLE/SCRIPT.py ). ## Before submitting - [X] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [X] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. @stevhliu hi, I believe you cloud revie this PR.
{ "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/39323/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/39323/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39322
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39322/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39322/comments
https://api.github.com/repos/huggingface/transformers/issues/39322/events
https://github.com/huggingface/transformers/pull/39322
3,217,449,819
PR_kwDOCUB6oc6eNMEM
39,322
Remove do_reduce_labels Argument from model initialization in run_semantic_segmentation_no_trainer
{ "login": "eromomon", "id": 110577233, "node_id": "U_kgDOBpdGUQ", "avatar_url": "https://avatars.githubusercontent.com/u/110577233?v=4", "gravatar_id": "", "url": "https://api.github.com/users/eromomon", "html_url": "https://github.com/eromomon", "followers_url": "https://api.github.com/users/eromomon/followers", "following_url": "https://api.github.com/users/eromomon/following{/other_user}", "gists_url": "https://api.github.com/users/eromomon/gists{/gist_id}", "starred_url": "https://api.github.com/users/eromomon/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eromomon/subscriptions", "organizations_url": "https://api.github.com/users/eromomon/orgs", "repos_url": "https://api.github.com/users/eromomon/repos", "events_url": "https://api.github.com/users/eromomon/events{/privacy}", "received_events_url": "https://api.github.com/users/eromomon/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-09T23:56:56
2025-07-14T10:16:49
2025-07-14T10:16:49
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39322", "html_url": "https://github.com/huggingface/transformers/pull/39322", "diff_url": "https://github.com/huggingface/transformers/pull/39322.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39322.patch", "merged_at": "2025-07-14T10:16:49" }
# What does this PR do? When running ```run_semantic_segmentation_no_trainer.py``` from ```example/pytorch/semantic-segmentation``` using the command provided in the Readme file: ```bash accelerate launch run_semantic_segmentation_no_trainer.py --output_dir segformer-finetuned-sidewalk --with_tracking --push_to_hub ``` An error is returned: ```bash TypeError: SegformerForSemanticSegmentation.__init__() got an unexpected keyword argument 'do_reduce_labels' ``` In the Python script, the model is instantiated with the class ```AutoModelForSemanticSegmentation```, which does not have listed ```do_reduce_labels``` as a parameter. This causes the test to fail. Proposed Change: This PR proposes removing line 333 from ```run_semantic_segmentation_no_trainer.py``` to resolve the issue. ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [X] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. @amyeroberts, @qubvel hi, I believe you could review this PR, as it pertains to the computer vision model field.
{ "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/39322/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/39322/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39321
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39321/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39321/comments
https://api.github.com/repos/huggingface/transformers/issues/39321/events
https://github.com/huggingface/transformers/pull/39321
3,217,338,155
PR_kwDOCUB6oc6eM0AI
39,321
make the loss context manager easier to extend
{ "login": "winglian", "id": 381258, "node_id": "MDQ6VXNlcjM4MTI1OA==", "avatar_url": "https://avatars.githubusercontent.com/u/381258?v=4", "gravatar_id": "", "url": "https://api.github.com/users/winglian", "html_url": "https://github.com/winglian", "followers_url": "https://api.github.com/users/winglian/followers", "following_url": "https://api.github.com/users/winglian/following{/other_user}", "gists_url": "https://api.github.com/users/winglian/gists{/gist_id}", "starred_url": "https://api.github.com/users/winglian/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/winglian/subscriptions", "organizations_url": "https://api.github.com/users/winglian/orgs", "repos_url": "https://api.github.com/users/winglian/repos", "events_url": "https://api.github.com/users/winglian/events{/privacy}", "received_events_url": "https://api.github.com/users/winglian/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-09T22:49:10
2025-07-16T13:47:25
2025-07-16T13:47:25
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39321", "html_url": "https://github.com/huggingface/transformers/pull/39321", "diff_url": "https://github.com/huggingface/transformers/pull/39321.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39321.patch", "merged_at": "2025-07-16T13:47:25" }
# What does this PR do? Using ExitStack makes it easier to extend the functionality of the context manager wrapping the `model(inputs)` call. This can make it easier to add other things like logging contexts, checkpointing contexts, etc down the road. e.g. ```python class CustomTrainer(Trainer): def compute_loss_context_manager(self): ctx_stack = super(). compute_loss_context_manager() my_custom_ctx = CustomContext(...) ctx_stack.enter_context(my_custom_ctx) return ctx_stack ```` Fixes # (issue) ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @SunMarc @ArthurZucker Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface, @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": "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/39321/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/39321/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39320
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39320/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39320/comments
https://api.github.com/repos/huggingface/transformers/issues/39320/events
https://github.com/huggingface/transformers/pull/39320
3,217,204,278
PR_kwDOCUB6oc6eMW1T
39,320
Add dates to the model docs
{ "login": "MHRDYN7", "id": 113298714, "node_id": "U_kgDOBsDNGg", "avatar_url": "https://avatars.githubusercontent.com/u/113298714?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MHRDYN7", "html_url": "https://github.com/MHRDYN7", "followers_url": "https://api.github.com/users/MHRDYN7/followers", "following_url": "https://api.github.com/users/MHRDYN7/following{/other_user}", "gists_url": "https://api.github.com/users/MHRDYN7/gists{/gist_id}", "starred_url": "https://api.github.com/users/MHRDYN7/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MHRDYN7/subscriptions", "organizations_url": "https://api.github.com/users/MHRDYN7/orgs", "repos_url": "https://api.github.com/users/MHRDYN7/repos", "events_url": "https://api.github.com/users/MHRDYN7/events{/privacy}", "received_events_url": "https://api.github.com/users/MHRDYN7/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-09T21:28:33
2025-08-14T17:08:47
2025-08-14T17:08:46
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39320", "html_url": "https://github.com/huggingface/transformers/pull/39320", "diff_url": "https://github.com/huggingface/transformers/pull/39320.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39320.patch", "merged_at": "2025-08-14T17:08:46" }
Implementation of the feature requested in #39319 (please look at the issue for more info). The file add_paper_dates_on_docs.py inside utils contains the main code. Current trivial strategy: Collect the paper id from the first link to hf papers -> use arxiv api to get the dates -> write the dates info below the last html '</div>' tag. ```python # for the paper publication and last update dates paper_ids = re.findall(r"https://huggingface\.co/papers/(\d+\.\d+)", content) if paper_ids: paper_id = paper_ids[0] try: search = Search(id_list=[paper_id]) results = client.results(search) result = next(results) published_date = result.published.date() updated_date = result.updated.date() ``` ```python # for HF integration date first_commit_date = subprocess.check_output(["git", "log", "--reverse", "--pretty=format:%ad", "--date=iso", path],text=True).strip().split('\n')[0][:10] ``` Most models that have an associated paper have got the html tags for the torch symbol on top, but some new model_docs don't seem to have that properly and those have been missed with this logic. Although it is highly likely that the first link to a paper is the main paper, I did find a good deal of suspicious dates on a random check, so there should be a much more robust strategy.
{ "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/39320/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/39320/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39319
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39319/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39319/comments
https://api.github.com/repos/huggingface/transformers/issues/39319/events
https://github.com/huggingface/transformers/issues/39319
3,217,108,869
I_kwDOCUB6oc6_wS-F
39,319
Add HF integration dates + paper release dates to the model docs
{ "login": "MHRDYN7", "id": 113298714, "node_id": "U_kgDOBsDNGg", "avatar_url": "https://avatars.githubusercontent.com/u/113298714?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MHRDYN7", "html_url": "https://github.com/MHRDYN7", "followers_url": "https://api.github.com/users/MHRDYN7/followers", "following_url": "https://api.github.com/users/MHRDYN7/following{/other_user}", "gists_url": "https://api.github.com/users/MHRDYN7/gists{/gist_id}", "starred_url": "https://api.github.com/users/MHRDYN7/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MHRDYN7/subscriptions", "organizations_url": "https://api.github.com/users/MHRDYN7/orgs", "repos_url": "https://api.github.com/users/MHRDYN7/repos", "events_url": "https://api.github.com/users/MHRDYN7/events{/privacy}", "received_events_url": "https://api.github.com/users/MHRDYN7/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-07-09T20:52:43
2025-08-14T17:16:44
2025-08-14T17:16:44
CONTRIBUTOR
null
null
null
null
### Feature request The model docs should have the dates of publication and last update of the paper mentioned. There should also be the date when this model was add to the transformers library. ### Motivation Since there are so many models in transformers, it is hard to realize which models are relevant and more up-to-date. Having the dates like this <img width="1310" height="373" alt="Image" src="https://github.com/user-attachments/assets/543cc882-5cf1-4546-a692-4f6a9ad3e3c7" /> will make it a lot easier for the people using these docs to explore model architectures and papers. It allows people to quickly see the order in which comparable papers were published and get better idea of the evolution of model architectures. ### Your contribution I want to help implement the pipeline that will correctly assign the correct dates related to the papers using the arxiv api. This is relatively simple if there exists a paper associated to the model. If the model's org publishes a blogpost or something then it will be a bit more complex. @stevhliu what are your thoughts?
{ "login": "MHRDYN7", "id": 113298714, "node_id": "U_kgDOBsDNGg", "avatar_url": "https://avatars.githubusercontent.com/u/113298714?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MHRDYN7", "html_url": "https://github.com/MHRDYN7", "followers_url": "https://api.github.com/users/MHRDYN7/followers", "following_url": "https://api.github.com/users/MHRDYN7/following{/other_user}", "gists_url": "https://api.github.com/users/MHRDYN7/gists{/gist_id}", "starred_url": "https://api.github.com/users/MHRDYN7/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MHRDYN7/subscriptions", "organizations_url": "https://api.github.com/users/MHRDYN7/orgs", "repos_url": "https://api.github.com/users/MHRDYN7/repos", "events_url": "https://api.github.com/users/MHRDYN7/events{/privacy}", "received_events_url": "https://api.github.com/users/MHRDYN7/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39319/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/39319/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/39318
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39318/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39318/comments
https://api.github.com/repos/huggingface/transformers/issues/39318/events
https://github.com/huggingface/transformers/issues/39318
3,216,821,990
I_kwDOCUB6oc6_vM7m
39,318
Whisper demo code for model + processor API is broken
{ "login": "piotyrus", "id": 472646, "node_id": "MDQ6VXNlcjQ3MjY0Ng==", "avatar_url": "https://avatars.githubusercontent.com/u/472646?v=4", "gravatar_id": "", "url": "https://api.github.com/users/piotyrus", "html_url": "https://github.com/piotyrus", "followers_url": "https://api.github.com/users/piotyrus/followers", "following_url": "https://api.github.com/users/piotyrus/following{/other_user}", "gists_url": "https://api.github.com/users/piotyrus/gists{/gist_id}", "starred_url": "https://api.github.com/users/piotyrus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/piotyrus/subscriptions", "organizations_url": "https://api.github.com/users/piotyrus/orgs", "repos_url": "https://api.github.com/users/piotyrus/repos", "events_url": "https://api.github.com/users/piotyrus/events{/privacy}", "received_events_url": "https://api.github.com/users/piotyrus/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-07-09T18:45:37
2025-08-18T08:03:16
2025-08-18T08:03:16
NONE
null
null
null
null
### System Info When running a copy-paste code of '4.48.3', log mel spectogram values are not padded to the length required by the model. This is the exact error message: ``` ValueError: Whisper expects the mel input features to be of length 3000, but found 585. Make sure to pad the input mel features to 3000. ``` It appears that the demo code is missing a logic to pad the log mel spectogram values to the multiple of 3000. ### 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 Run the code on CPU as in https://huggingface.co/openai/whisper-large-v3: ``` import torch from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor from datasets import Audio, load_dataset device = "cuda:0" if torch.cuda.is_available() else "cpu" torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32 model_id = "openai/whisper-large-v3" model = AutoModelForSpeechSeq2Seq.from_pretrained( model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True ) model.to(device) processor = AutoProcessor.from_pretrained(model_id) dataset = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation") dataset = dataset.cast_column("audio", Audio(processor.feature_extractor.sampling_rate)) sample = dataset[0]["audio"] inputs = processor( sample["array"], sampling_rate=sample["sampling_rate"], return_tensors="pt", truncation=False, padding="longest", return_attention_mask=True, ) inputs = inputs.to(device, dtype=torch_dtype) gen_kwargs = { "max_new_tokens": 448, "num_beams": 1, "condition_on_prev_tokens": False, "compression_ratio_threshold": 1.35, # zlib compression ratio threshold (in token space) "temperature": (0.0, 0.2, 0.4, 0.6, 0.8, 1.0), "logprob_threshold": -1.0, "no_speech_threshold": 0.6, "return_timestamps": True, } pred_ids = model.generate(**inputs, **gen_kwargs) pred_text = processor.batch_decode(pred_ids, skip_special_tokens=True, decode_with_timestamps=False) print(pred_text) ``` ### Expected behavior correct transcription of an audio sample
{ "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/39318/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/39318/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/39317
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39317/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39317/comments
https://api.github.com/repos/huggingface/transformers/issues/39317/events
https://github.com/huggingface/transformers/pull/39317
3,216,799,353
PR_kwDOCUB6oc6eK9xA
39,317
Fix typo: langauge -> language
{ "login": "tomaarsen", "id": 37621491, "node_id": "MDQ6VXNlcjM3NjIxNDkx", "avatar_url": "https://avatars.githubusercontent.com/u/37621491?v=4", "gravatar_id": "", "url": "https://api.github.com/users/tomaarsen", "html_url": "https://github.com/tomaarsen", "followers_url": "https://api.github.com/users/tomaarsen/followers", "following_url": "https://api.github.com/users/tomaarsen/following{/other_user}", "gists_url": "https://api.github.com/users/tomaarsen/gists{/gist_id}", "starred_url": "https://api.github.com/users/tomaarsen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tomaarsen/subscriptions", "organizations_url": "https://api.github.com/users/tomaarsen/orgs", "repos_url": "https://api.github.com/users/tomaarsen/repos", "events_url": "https://api.github.com/users/tomaarsen/events{/privacy}", "received_events_url": "https://api.github.com/users/tomaarsen/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-09T18:34:59
2025-07-09T19:06:48
2025-07-09T19:06:46
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39317", "html_url": "https://github.com/huggingface/transformers/pull/39317", "diff_url": "https://github.com/huggingface/transformers/pull/39317.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39317.patch", "merged_at": "2025-07-09T19:06:46" }
Hello! ## Pull Request overview * Fix typo: langauge -> language ## Details I noticed this typo on the [T5Gemma docs](https://huggingface.co/docs/transformers/model_doc/t5gemma), should speak for itself πŸ€— Documentation: @stevhliu P.s. these don't seem to be working correctly: `<hfoptions id="usage"> <hfoption id="Pipeline">` ![image](https://github.com/user-attachments/assets/705bdeac-4204-43a1-822d-00f5bc436347) - Tom Aarsen
{ "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/39317/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/39317/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39316
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39316/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39316/comments
https://api.github.com/repos/huggingface/transformers/issues/39316/events
https://github.com/huggingface/transformers/pull/39316
3,216,657,370
PR_kwDOCUB6oc6eKew3
39,316
skip files in `src/` for doctest (for now)
{ "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-07-09T17:32:11
2025-07-09T17:45:10
2025-07-09T17:36:48
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39316", "html_url": "https://github.com/huggingface/transformers/pull/39316", "diff_url": "https://github.com/huggingface/transformers/pull/39316.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39316.patch", "merged_at": "2025-07-09T17:36:48" }
# What does this PR do? Fix #39159 Merge directly as https://github.com/huggingface/transformers/issues/39159#issuecomment-3045160413
{ "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/39316/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/39316/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39315
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39315/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39315/comments
https://api.github.com/repos/huggingface/transformers/issues/39315/events
https://github.com/huggingface/transformers/pull/39315
3,216,589,426
PR_kwDOCUB6oc6eKP1w
39,315
add `stevhliu` to the list in `self-comment-ci.yml`
{ "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-07-09T17:05:09
2025-07-09T17:18:26
2025-07-09T17:07:44
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39315", "html_url": "https://github.com/huggingface/transformers/pull/39315", "diff_url": "https://github.com/huggingface/transformers/pull/39315.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39315.patch", "merged_at": "2025-07-09T17:07:44" }
# What does this PR do? welcome @stevhliu
{ "login": "ydshieh", "id": 2521628, "node_id": "MDQ6VXNlcjI1MjE2Mjg=", "avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ydshieh", "html_url": "https://github.com/ydshieh", "followers_url": "https://api.github.com/users/ydshieh/followers", "following_url": "https://api.github.com/users/ydshieh/following{/other_user}", "gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}", "starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions", "organizations_url": "https://api.github.com/users/ydshieh/orgs", "repos_url": "https://api.github.com/users/ydshieh/repos", "events_url": "https://api.github.com/users/ydshieh/events{/privacy}", "received_events_url": "https://api.github.com/users/ydshieh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39315/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/39315/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39314
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39314/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39314/comments
https://api.github.com/repos/huggingface/transformers/issues/39314/events
https://github.com/huggingface/transformers/pull/39314
3,216,501,959
PR_kwDOCUB6oc6eJ9Aw
39,314
Fix consistency and a few docstrings warnings
{ "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-07-09T16:25:19
2025-07-09T16:48:03
2025-07-09T16:40:37
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39314", "html_url": "https://github.com/huggingface/transformers/pull/39314", "diff_url": "https://github.com/huggingface/transformers/pull/39314.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39314.patch", "merged_at": "2025-07-09T16:40:37" }
# What does this PR do? Race condition on modular conversion for Deepseek v2 + a few docstrings at the same time.
{ "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/39314/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/39314/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39313
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39313/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39313/comments
https://api.github.com/repos/huggingface/transformers/issues/39313/events
https://github.com/huggingface/transformers/pull/39313
3,216,414,034
PR_kwDOCUB6oc6eJplI
39,313
Fix DAC integration tests and checkpoint conversion.
{ "login": "ebezzam", "id": 4757445, "node_id": "MDQ6VXNlcjQ3NTc0NDU=", "avatar_url": "https://avatars.githubusercontent.com/u/4757445?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ebezzam", "html_url": "https://github.com/ebezzam", "followers_url": "https://api.github.com/users/ebezzam/followers", "following_url": "https://api.github.com/users/ebezzam/following{/other_user}", "gists_url": "https://api.github.com/users/ebezzam/gists{/gist_id}", "starred_url": "https://api.github.com/users/ebezzam/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ebezzam/subscriptions", "organizations_url": "https://api.github.com/users/ebezzam/orgs", "repos_url": "https://api.github.com/users/ebezzam/repos", "events_url": "https://api.github.com/users/ebezzam/events{/privacy}", "received_events_url": "https://api.github.com/users/ebezzam/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 6470596964, "node_id": "LA_kwDOCUB6oc8AAAABga15ZA", "url": "https://api.github.com/repos/huggingface/transformers/labels/Audio", "name": "Audio", "color": "760453", "default": false, "description": "" } ]
closed
false
null
[]
null
[]
2025-07-09T15:55:04
2025-07-23T17:21:32
2025-07-23T17:21:26
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39313", "html_url": "https://github.com/huggingface/transformers/pull/39313", "diff_url": "https://github.com/huggingface/transformers/pull/39313.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39313.patch", "merged_at": "2025-07-23T17:21:26" }
# What does this PR do? Multiple things were wrong with the tests: - The expected outputs. I created this gist to reproduce **new** expected outputs (as not possible to reproduce previous ones): https://gist.github.com/ebezzam/bb315efa7a416db6336a6b2a2d424ffa - Hop length was incorrectly set on the Hub for [16kHz](https://huggingface.co/descript/dac_16khz/blob/main/preprocessor_config.json#L4) and [24kHz](https://huggingface.co/descript/dac_24khz/blob/main/preprocessor_config.json#L4) (UPDATE: corrected from 512 to 320 thanks to merged PR by Descript team). I’ve corrected in the conversion script for future use. Below are the test outputs when the Hop length is incorrect (3/6 tests fail): ```bash # RUN_SLOW=1 pytest tests/models/dac/test_modeling_dac.py::DacIntegrationTest tests/models/dac/test_modeling_dac.py::DacIntegrationTest::test_integration_16khz FAILED [ 16%] tests/models/dac/test_modeling_dac.py::DacIntegrationTest::test_integration_24khz PASSED [ 33%] tests/models/dac/test_modeling_dac.py::DacIntegrationTest::test_integration_44khz PASSED [ 50%] tests/models/dac/test_modeling_dac.py::DacIntegrationTest::test_integration_batch_16khz FAILED [ 66%] tests/models/dac/test_modeling_dac.py::DacIntegrationTest::test_integration_batch_24khz FAILED [ 83%] tests/models/dac/test_modeling_dac.py::DacIntegrationTest::test_integration_batch_44khz PASSED [100%] ``` Also I’ve standardized the tests (24kHz was testing something else) and added tests on quantizer and decoder outputs. # Note on high tolerances for encoder and decoder Previous (and still now) the tests for the encoder outputs have a high tolerance (1e-3). With [this script](https://gist.github.com/ebezzam/bb315efa7a416db6336a6b2a2d424ffa#file-dac_layer_by_layer_debugging-py), I've verified that the weights have been mapped correctly (output snippet below). ```bash=== WEIGHT DIFFERENCES BY LAYER === Conv1 weight max diff: 5.96e-08 Block 0 weight differences: Block conv weight diff: 1.49e-08 res_unit1.conv1 diff: 2.24e-08 res_unit1.conv2 diff: 2.98e-08 res_unit2.conv1 diff: 1.49e-08 res_unit2.conv2 diff: 2.98e-08 res_unit3.conv1 diff: 1.49e-08 res_unit3.conv2 diff: 2.98e-08 Block 1 weight differences: Block conv weight diff: 1.49e-08 res_unit1.conv1 diff: 1.49e-08 res_unit1.conv2 diff: 2.98e-08 res_unit2.conv1 diff: 2.24e-08 res_unit2.conv2 diff: 5.96e-08 res_unit3.conv1 diff: 1.49e-08 res_unit3.conv2 diff: 2.98e-08 Block 2 weight differences: Block conv weight diff: 1.49e-08 res_unit1.conv1 diff: 2.98e-08 res_unit1.conv2 diff: 2.98e-08 res_unit2.conv1 diff: 2.98e-08 res_unit2.conv2 diff: 5.96e-08 res_unit3.conv1 diff: 1.49e-08 res_unit3.conv2 diff: 2.98e-08 Block 3 weight differences: Block conv weight diff: 2.24e-08 res_unit1.conv1 diff: 2.24e-08 res_unit1.conv2 diff: 2.98e-08 res_unit2.conv1 diff: 2.24e-08 res_unit2.conv2 diff: 2.98e-08 res_unit3.conv1 diff: 4.47e-08 res_unit3.conv2 diff: 2.98e-08 Snake1 alpha diff: 0.00e+00 Conv2 weight diff: 1.49e-08 ``` However, error exponentially increases through encoder and decoder layers. From my understanding, it is because the Transformers version of DAC does NOT have weight normalization in its architecture, while the Original version does (**see [model addition PR](https://github.com/huggingface/transformers/pull/31494#discussion_r1661296778) for discussion as to why there is no weight normalization in the Transformers version**). This causes small differences between expected outputs at each layer, which get larger and larger tensors go deeper in the network. Below is output snippet of error propagation through the encoder for the 44.1kHz model, calculated with the [same script](https://gist.github.com/ebezzam/bb315efa7a416db6336a6b2a2d424ffa#file-dac_layer_by_layer_debugging-py). ```bash === ENCODER ERROR PROPAGATION ANALYSIS === Layer Max Error Mean Error Error Growth ---------------------------------------------------------------------- Input 0.00e+00 0.00e+00 1.0x Conv1 1.19e-07 1.32e-09 infx Block0 2.26e-04 3.54e-06 1897.0x --- Block 0 Internal Analysis --- res_unit1: 1.45e-05 (121.9x) res_unit2: 5.70e-05 (478.0x) res_unit3: 2.00e-04 (1680.0x) Final layers: 5.57e-04 (4670.2x) Block1 5.99e-03 1.17e-04 26.5x --- Block 1 Internal Analysis --- res_unit1: 1.43e-03 (6.3x) res_unit2: 1.65e-03 (7.3x) res_unit3: 6.91e-03 (30.6x) Final layers: 1.17e-02 (51.6x) Block2 1.61e-02 1.82e-04 2.7x --- Block 2 Internal Analysis --- res_unit1: 1.99e-02 (3.3x) res_unit2: 3.75e-02 (6.3x) res_unit3: 5.91e-02 (9.9x) Final layers: 3.76e-02 (6.3x) Block3 3.64e-02 8.27e-04 2.3x --- Block 3 Internal Analysis --- res_unit1: 1.61e-02 (1.0x) res_unit2: 3.24e-02 (2.0x) res_unit3: 8.89e-02 (5.5x) Final layers: 2.32e-01 (14.4x) Snake1 7.28e-02 7.92e-04 2.0x Conv2 2.75e-02 9.82e-04 0.4x === ERROR PROPAGATION SUMMARY === Initial weight error: 1.19e-07 Final encoder error: 2.75e-02 Total error amplification: 230790x Top 3 error amplifiers: 1. Block0: 1897.0x amplification 2. Block1: 26.5x amplification 3. Block2: 2.7x amplification ``` - `Conv1` already has weight normalization in [original model](https://github.com/descriptinc/descript-audio-codec/blob/c7cfc5d2647e26471dc394f95846a0830e7bec34/dac/model/dac.py#L73), and we see a minimal error (precision-limited). - `Block0` has 7x layers with weight norm (see [original model](https://github.com/descriptinc/descript-audio-codec/blob/c7cfc5d2647e26471dc394f95846a0830e7bec34/dac/model/dac.py#L46)), and that's where we get the big jump in deviation with the Transformer model -- 1897x. We also have to keep [decoder test tolerances](https://github.com/ebezzam/transformers/blob/60004f561587f699960b4152ba2be9152c91b60a/tests/models/dac/test_modeling_dac.py#L476) quite high for the same reasons, propagation of weight normalization error. ## Fortunately we can still use Transformers version as a valid approximation Because: - quantizer is not affected by this precision error thanks to discretization, allowing us to keep tolerances [in the tests](https://github.com/ebezzam/transformers/blob/60004f561587f699960b4152ba2be9152c91b60a/tests/models/dac/test_modeling_dac.py#L465) at `1e-6` - the error due the codec itself, is very similar between both approaches (see [gist](https://gist.github.com/ebezzam/bb315efa7a416db6336a6b2a2d424ffa#file-dac_integration-py-L175)), allowing us keep tolerances at `1e-6` for the codec error
{ "login": "ebezzam", "id": 4757445, "node_id": "MDQ6VXNlcjQ3NTc0NDU=", "avatar_url": "https://avatars.githubusercontent.com/u/4757445?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ebezzam", "html_url": "https://github.com/ebezzam", "followers_url": "https://api.github.com/users/ebezzam/followers", "following_url": "https://api.github.com/users/ebezzam/following{/other_user}", "gists_url": "https://api.github.com/users/ebezzam/gists{/gist_id}", "starred_url": "https://api.github.com/users/ebezzam/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ebezzam/subscriptions", "organizations_url": "https://api.github.com/users/ebezzam/orgs", "repos_url": "https://api.github.com/users/ebezzam/repos", "events_url": "https://api.github.com/users/ebezzam/events{/privacy}", "received_events_url": "https://api.github.com/users/ebezzam/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39313/reactions", "total_count": 2, "+1": 0, "-1": 0, "laugh": 0, "hooray": 2, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/39313/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39312
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39312/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39312/comments
https://api.github.com/repos/huggingface/transformers/issues/39312/events
https://github.com/huggingface/transformers/pull/39312
3,216,373,535
PR_kwDOCUB6oc6eJhVC
39,312
fix `phi3` 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-07-09T15:41:53
2025-07-10T09:51:57
2025-07-10T09:51:55
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39312", "html_url": "https://github.com/huggingface/transformers/pull/39312", "diff_url": "https://github.com/huggingface/transformers/pull/39312.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39312.patch", "merged_at": "2025-07-10T09:51:55" }
# What does this PR do? These 2 tests are never passing after (#31436) , as we didn't update the expected outputs after Rename Phi-3 rope scaling type (#31436)
{ "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/39312/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/39312/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39311
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39311/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39311/comments
https://api.github.com/repos/huggingface/transformers/issues/39311/events
https://github.com/huggingface/transformers/issues/39311
3,216,226,204
I_kwDOCUB6oc6_s7ec
39,311
Inference with model.generate( ) using a quantized model leads to assertion error
{ "login": "Sandipan99", "id": 9780288, "node_id": "MDQ6VXNlcjk3ODAyODg=", "avatar_url": "https://avatars.githubusercontent.com/u/9780288?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Sandipan99", "html_url": "https://github.com/Sandipan99", "followers_url": "https://api.github.com/users/Sandipan99/followers", "following_url": "https://api.github.com/users/Sandipan99/following{/other_user}", "gists_url": "https://api.github.com/users/Sandipan99/gists{/gist_id}", "starred_url": "https://api.github.com/users/Sandipan99/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Sandipan99/subscriptions", "organizations_url": "https://api.github.com/users/Sandipan99/orgs", "repos_url": "https://api.github.com/users/Sandipan99/repos", "events_url": "https://api.github.com/users/Sandipan99/events{/privacy}", "received_events_url": "https://api.github.com/users/Sandipan99/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-07-09T14:53:16
2025-08-18T08:03:17
2025-08-18T08:03:17
NONE
null
null
null
null
### System Info Linux transformers==4.52.4 bitsandbytes==0.46.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 ~~~ m = "microsoft/phi-4" bnb_config = BitsAndBytesConfig( load_in_4bit=True ) tokenizer = AutoTokenizer.from_pretrained(m) model = AutoModelForCausalLM.from_pretrained(m, quantization_config=bnb_config, device_map='auto') tokenizer.pad_token_id = tokenizer.eos_token_id inputs = tokenizer.apply_chat_template(prompt, return_tensors="pt").to('cuda') out = model.generate(inputs, max_new_tokens=50, synced_gpus=True) ~~~ Run with: ~~~ torchrun --nproc-per-node=2 script.py ~~~ Works perfectly fine with a single GPU setup, but produces assertion error when running on multiple GPUs The error can be traced back to model.generate() function error: Assertion error, python3.10/site-packages/bitsandbytes/nn/modules.py in fix_4bit_weight_quant_state_from_module assert module.weight.shape[1] == 1 ### Expected behavior Expect the model to execute generation without error
{ "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/39311/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/39311/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/39310
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39310/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39310/comments
https://api.github.com/repos/huggingface/transformers/issues/39310/events
https://github.com/huggingface/transformers/pull/39310
3,216,073,012
PR_kwDOCUB6oc6eIf_G
39,310
Add a default value for `position_ids` in masking_utils
{ "login": "Cyrilvallez", "id": 71554963, "node_id": "MDQ6VXNlcjcxNTU0OTYz", "avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Cyrilvallez", "html_url": "https://github.com/Cyrilvallez", "followers_url": "https://api.github.com/users/Cyrilvallez/followers", "following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}", "gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}", "starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions", "organizations_url": "https://api.github.com/users/Cyrilvallez/orgs", "repos_url": "https://api.github.com/users/Cyrilvallez/repos", "events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}", "received_events_url": "https://api.github.com/users/Cyrilvallez/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 8103865784, "node_id": "LA_kwDOCUB6oc8AAAAB4wctuA", "url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch", "name": "for patch", "color": "D93F0B", "default": false, "description": "Tag issues / labels that should be included in the next patch" } ]
closed
false
null
[]
null
[]
2025-07-09T14:02:21
2025-07-10T16:53:42
2025-07-10T16:53:41
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39310", "html_url": "https://github.com/huggingface/transformers/pull/39310", "diff_url": "https://github.com/huggingface/transformers/pull/39310.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39310.patch", "merged_at": "2025-07-10T16:53:41" }
# What does this PR do? As per the title. See related discussion in https://github.com/huggingface/transformers/pull/39194 Also cc @BenjaminBossan, sorry again for the inconvenience on this one!
{ "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/39310/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/39310/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39309
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39309/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39309/comments
https://api.github.com/repos/huggingface/transformers/issues/39309/events
https://github.com/huggingface/transformers/pull/39309
3,216,052,122
PR_kwDOCUB6oc6eIbYF
39,309
Fix audio pipeline with torchcodec input
{ "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 }
[]
open
false
null
[]
null
[]
2025-07-09T13:55:48
2025-08-01T07:58:15
null
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39309", "html_url": "https://github.com/huggingface/transformers/pull/39309", "diff_url": "https://github.com/huggingface/transformers/pull/39309.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39309.patch", "merged_at": null }
fix `tests/pipelines/test_pipelines_automatic_speech_recognition.py::AutomaticSpeechRecognitionPipelineTests::test_speculative_decoding_whisper_distil` which has ``` ValueError: When passing a dictionary to AutomaticSpeechRecognitionPipeline, the dict needs to contain a "raw" key containing the numpy array or torch tensor representing the audio and a "sampling_rate" key, containing the sampling_rate associated with that array ```
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39309/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/39309/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39308
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39308/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39308/comments
https://api.github.com/repos/huggingface/transformers/issues/39308/events
https://github.com/huggingface/transformers/pull/39308
3,216,002,879
PR_kwDOCUB6oc6eIQbt
39,308
[modular] Allow method with the same name in case of @property decorator
{ "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-07-09T13:42:01
2025-07-09T13:55:57
2025-07-09T13:46:53
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39308", "html_url": "https://github.com/huggingface/transformers/pull/39308", "diff_url": "https://github.com/huggingface/transformers/pull/39308.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39308.patch", "merged_at": "2025-07-09T13:46:53" }
# What does this PR do? As per the title. See added examples. Needed for #39301 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 }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39308/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/39308/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39307
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39307/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39307/comments
https://api.github.com/repos/huggingface/transformers/issues/39307/events
https://github.com/huggingface/transformers/pull/39307
3,215,975,011
PR_kwDOCUB6oc6eIKPf
39,307
skip `test_torchscript_*` for now until the majority of the community ask for it
{ "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-07-09T13:33:32
2025-07-09T13:47:09
2025-07-09T13:35:48
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39307", "html_url": "https://github.com/huggingface/transformers/pull/39307", "diff_url": "https://github.com/huggingface/transformers/pull/39307.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39307.patch", "merged_at": "2025-07-09T13:35:48" }
# What does this PR do? As discussed with the core maintainer(s) offline. For the record, the trace log (after #39120) is ```bash > traced_model = torch.jit.trace(model, (main_input,)) tests/test_modeling_common.py:1453: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/torch/_dynamo/eval_frame.py:838: in _fn return fn(*args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/jit/_trace.py:1002: in trace traced_func = _trace_impl( /usr/local/lib/python3.10/dist-packages/torch/jit/_trace.py:696: in _trace_impl return trace_module( /usr/local/lib/python3.10/dist-packages/torch/jit/_trace.py:1279: in trace_module module._c._create_method_from_trace( /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1751: in _wrapped_call_impl return self._call_impl(*args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1762: in _call_impl return forward_call(*args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1741: in _slow_forward result = self.forward(*input, **kwargs) src/transformers/utils/generic.py:1060: in wrapper outputs = func(self, *args, **kwargs) src/transformers/models/llama/modeling_llama.py:396: in forward causal_mask = create_causal_mask( src/transformers/masking_utils.py:793: in create_causal_mask causal_mask = mask_interface( src/transformers/masking_utils.py:482: in eager_mask mask = sdpa_mask( src/transformers/masking_utils.py:366: in sdpa_mask_recent_torch causal_mask = _vmap_for_bhqkv(mask_function)(batch_arange, head_arange, cache_position, kv_arange) /usr/local/lib/python3.10/dist-packages/torch/_functorch/apis.py:202: in wrapped return vmap_impl( /usr/local/lib/python3.10/dist-packages/torch/_functorch/vmap.py:334: in vmap_impl return _flat_vmap( /usr/local/lib/python3.10/dist-packages/torch/_functorch/vmap.py:484: in _flat_vmap batched_outputs = func(*batched_inputs, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/apis.py:202: in wrapped return vmap_impl( /usr/local/lib/python3.10/dist-packages/torch/_functorch/vmap.py:334: in vmap_impl return _flat_vmap( /usr/local/lib/python3.10/dist-packages/torch/_functorch/vmap.py:484: in _flat_vmap batched_outputs = func(*batched_inputs, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/apis.py:202: in wrapped return vmap_impl( /usr/local/lib/python3.10/dist-packages/torch/_functorch/vmap.py:334: in vmap_impl return _flat_vmap( /usr/local/lib/python3.10/dist-packages/torch/_functorch/vmap.py:484: in _flat_vmap batched_outputs = func(*batched_inputs, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/apis.py:202: in wrapped return vmap_impl( /usr/local/lib/python3.10/dist-packages/torch/_functorch/vmap.py:334: in vmap_impl return _flat_vmap( /usr/local/lib/python3.10/dist-packages/torch/_functorch/vmap.py:484: in _flat_vmap batched_outputs = func(*batched_inputs, **kwargs) src/transformers/masking_utils.py:49: in and_mask result = result & mask(batch_idx, head_idx, q_idx, kv_idx) src/transformers/masking_utils.py:134: in inner_mask return packed_sequence_mask[batch_idx, q_idx] == packed_sequence_mask[batch_idx, kv_idx] /usr/local/lib/python3.10/dist-packages/torch/_dynamo/_trace_wrapped_higher_order_op.py:141: in __torch_function__ return mod_index(args[0], index_args) /usr/local/lib/python3.10/dist-packages/torch/autograd/function.py:585: in apply return custom_function_call(cls, *args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:49: in __call__ return super().__call__(autograd_function, *args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_ops.py:471: in __call__ return wrapper() /usr/local/lib/python3.10/dist-packages/torch/_ops.py:467: in wrapper return self.dispatch( /usr/local/lib/python3.10/dist-packages/torch/_ops.py:330: in dispatch return dispatch_functorch(self, args, kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/pyfunctorch.py:294: in dispatch_functorch return interpreter.process(op, args, kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/pyfunctorch.py:130: in process return kernel(self, *args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:300: in custom_function_call_vmap return custom_function_call_vmap_generate_rule( /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:384: in custom_function_call_vmap_generate_rule outputs = custom_function_call(vmapped_function, *unwrapped_operands) /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:49: in __call__ return super().__call__(autograd_function, *args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_ops.py:471: in __call__ return wrapper() /usr/local/lib/python3.10/dist-packages/torch/_ops.py:467: in wrapper return self.dispatch( /usr/local/lib/python3.10/dist-packages/torch/_ops.py:330: in dispatch return dispatch_functorch(self, args, kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/pyfunctorch.py:294: in dispatch_functorch return interpreter.process(op, args, kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/pyfunctorch.py:130: in process return kernel(self, *args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:300: in custom_function_call_vmap return custom_function_call_vmap_generate_rule( /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:384: in custom_function_call_vmap_generate_rule outputs = custom_function_call(vmapped_function, *unwrapped_operands) /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:49: in __call__ return super().__call__(autograd_function, *args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_ops.py:471: in __call__ return wrapper() /usr/local/lib/python3.10/dist-packages/torch/_ops.py:467: in wrapper return self.dispatch( /usr/local/lib/python3.10/dist-packages/torch/_ops.py:330: in dispatch return dispatch_functorch(self, args, kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/pyfunctorch.py:294: in dispatch_functorch return interpreter.process(op, args, kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/pyfunctorch.py:130: in process return kernel(self, *args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:300: in custom_function_call_vmap return custom_function_call_vmap_generate_rule( /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:384: in custom_function_call_vmap_generate_rule outputs = custom_function_call(vmapped_function, *unwrapped_operands) /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:49: in __call__ return super().__call__(autograd_function, *args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_ops.py:471: in __call__ return wrapper() /usr/local/lib/python3.10/dist-packages/torch/_ops.py:467: in wrapper return self.dispatch( /usr/local/lib/python3.10/dist-packages/torch/_ops.py:330: in dispatch return dispatch_functorch(self, args, kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/pyfunctorch.py:294: in dispatch_functorch return interpreter.process(op, args, kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/pyfunctorch.py:130: in process return kernel(self, *args, **kwargs) /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:300: in custom_function_call_vmap return custom_function_call_vmap_generate_rule( /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:384: in custom_function_call_vmap_generate_rule outputs = custom_function_call(vmapped_function, *unwrapped_operands) /usr/local/lib/python3.10/dist-packages/torch/_functorch/autograd_function.py:50: in __call__ return autograd_function.apply(*args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = <class 'torch._functorch.autograd_function.VmappedVmappedVmappedVmappedModIndex'> args = (tensor([[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, ... 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], device='cuda:0'), tensor([0, 1, 2, 3, 4, 5, 6], device='cuda:0')]), kwargs = {} bind_default_args = <function Function.apply.<locals>.bind_default_args at 0x7fda91408700>, is_setup_ctx_defined = True @classmethod def apply(cls, *args, **kwargs): def bind_default_args(func, *args, **kwargs): signature = inspect.signature(func) bound_args = signature.bind(*args, **kwargs) bound_args.apply_defaults() return bound_args.args is_setup_ctx_defined = _is_setup_context_defined(cls.setup_context) if is_setup_ctx_defined: args = bind_default_args(cls.forward, *args, **kwargs) if not torch._C._are_functorch_transforms_active(): # See NOTE: [functorch vjp and autograd interaction] args = _functorch.utils.unwrap_dead_wrappers(args) > return super().apply(*args, **kwargs) # type: ignore[misc] E RuntimeError: _Map_base::at /usr/local/lib/python3.10/dist-packages/torch/autograd/function.py:575: RuntimeError During handling of the above exception, another exception occurred: self = <tests.models.llama.test_modeling_llama.LlamaModelTest testMethod=test_torchscript_simple> @slow def test_torchscript_simple(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() > self._create_and_check_torchscript(config, inputs_dict) tests/test_modeling_common.py:1350: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_modeling_common.py:1455: in _create_and_check_torchscript self.fail("Couldn't trace module.") E AssertionError: Couldn't trace module. ```
{ "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/39307/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/39307/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39306
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39306/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39306/comments
https://api.github.com/repos/huggingface/transformers/issues/39306/events
https://github.com/huggingface/transformers/pull/39306
3,215,920,949
PR_kwDOCUB6oc6eH-cp
39,306
Fix batch object detection 31356
{ "login": "z-pandeyji", "id": 91720238, "node_id": "U_kgDOBXeKLg", "avatar_url": "https://avatars.githubusercontent.com/u/91720238?v=4", "gravatar_id": "", "url": "https://api.github.com/users/z-pandeyji", "html_url": "https://github.com/z-pandeyji", "followers_url": "https://api.github.com/users/z-pandeyji/followers", "following_url": "https://api.github.com/users/z-pandeyji/following{/other_user}", "gists_url": "https://api.github.com/users/z-pandeyji/gists{/gist_id}", "starred_url": "https://api.github.com/users/z-pandeyji/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/z-pandeyji/subscriptions", "organizations_url": "https://api.github.com/users/z-pandeyji/orgs", "repos_url": "https://api.github.com/users/z-pandeyji/repos", "events_url": "https://api.github.com/users/z-pandeyji/events{/privacy}", "received_events_url": "https://api.github.com/users/z-pandeyji/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-07-09T13:16:29
2025-07-10T06:59:18
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39306", "html_url": "https://github.com/huggingface/transformers/pull/39306", "diff_url": "https://github.com/huggingface/transformers/pull/39306.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39306.patch", "merged_at": null }
@amyeroberts @Narsil ## Fixes #31356 **Issue**: Object Detection Pipeline only outputs first element when batching ## Solution The Object Detection Pipeline now correctly handles batched inputs, returning results for all images in the batch instead of just the first one. ## Verification - Single image processing works correctly - Batch processing now returns results for all images - Tested with multiple image types (URLs, PIL images) - All existing tests pass ## Before/After **Before**: `detector([img1, img2, img3])` β†’ Returns results for only img1 **After**: `detector([img1, img2, img3])` β†’ Returns results for all 3 images ## Technical Details - **Files modified**: `src/transformers/pipelines/object_detection.py` - **Performance**: No regression, improved batch efficiency - **Compatibility**: Fully backward compatible ## Impact - Fixes critical batching bug affecting users - Improves user experience for batch processing - No breaking changes
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39306/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/39306/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39305
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39305/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39305/comments
https://api.github.com/repos/huggingface/transformers/issues/39305/events
https://github.com/huggingface/transformers/pull/39305
3,215,917,919
PR_kwDOCUB6oc6eH9yv
39,305
Updated Switch Transformers model card with standardized format (Issue #36979)
{ "login": "giuseppeCoccia", "id": 29398916, "node_id": "MDQ6VXNlcjI5Mzk4OTE2", "avatar_url": "https://avatars.githubusercontent.com/u/29398916?v=4", "gravatar_id": "", "url": "https://api.github.com/users/giuseppeCoccia", "html_url": "https://github.com/giuseppeCoccia", "followers_url": "https://api.github.com/users/giuseppeCoccia/followers", "following_url": "https://api.github.com/users/giuseppeCoccia/following{/other_user}", "gists_url": "https://api.github.com/users/giuseppeCoccia/gists{/gist_id}", "starred_url": "https://api.github.com/users/giuseppeCoccia/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/giuseppeCoccia/subscriptions", "organizations_url": "https://api.github.com/users/giuseppeCoccia/orgs", "repos_url": "https://api.github.com/users/giuseppeCoccia/repos", "events_url": "https://api.github.com/users/giuseppeCoccia/events{/privacy}", "received_events_url": "https://api.github.com/users/giuseppeCoccia/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-09T13:15:31
2025-07-11T16:16:00
2025-07-10T22:34:10
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39305", "html_url": "https://github.com/huggingface/transformers/pull/39305", "diff_url": "https://github.com/huggingface/transformers/pull/39305.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39305.patch", "merged_at": "2025-07-10T22:34:10" }
# What does this PR do? It updates the model card for Switch Transformer by following a new standardized format #36979 ## 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 -> [link](https://github.com/huggingface/transformers/issues/36979#issuecomment-3052596321) - [X] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @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/39305/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/39305/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39304
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39304/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39304/comments
https://api.github.com/repos/huggingface/transformers/issues/39304/events
https://github.com/huggingface/transformers/pull/39304
3,215,887,574
PR_kwDOCUB6oc6eH3c1
39,304
update expected outputs for whisper after #38778
{ "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-07-09T13:05:09
2025-07-25T16:48:11
2025-07-25T16:48:11
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39304", "html_url": "https://github.com/huggingface/transformers/pull/39304", "diff_url": "https://github.com/huggingface/transformers/pull/39304.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39304.patch", "merged_at": "2025-07-25T16:48:11" }
# What does this PR do? The differences are actually minor (mostly at the end of the outputs)
{ "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/39304/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/39304/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39303
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39303/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39303/comments
https://api.github.com/repos/huggingface/transformers/issues/39303/events
https://github.com/huggingface/transformers/pull/39303
3,215,744,844
PR_kwDOCUB6oc6eHYPd
39,303
Fix critical typos in code example
{ "login": "zabojeb", "id": 128208855, "node_id": "U_kgDOB6RP1w", "avatar_url": "https://avatars.githubusercontent.com/u/128208855?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zabojeb", "html_url": "https://github.com/zabojeb", "followers_url": "https://api.github.com/users/zabojeb/followers", "following_url": "https://api.github.com/users/zabojeb/following{/other_user}", "gists_url": "https://api.github.com/users/zabojeb/gists{/gist_id}", "starred_url": "https://api.github.com/users/zabojeb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zabojeb/subscriptions", "organizations_url": "https://api.github.com/users/zabojeb/orgs", "repos_url": "https://api.github.com/users/zabojeb/repos", "events_url": "https://api.github.com/users/zabojeb/events{/privacy}", "received_events_url": "https://api.github.com/users/zabojeb/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-07-09T12:18:15
2025-07-09T12:24:52
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39303", "html_url": "https://github.com/huggingface/transformers/pull/39303", "diff_url": "https://github.com/huggingface/transformers/pull/39303.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39303.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 typos in code example of GPT2 that was making code not runnable - [link](https://huggingface.co/docs/transformers/model_doc/gpt2) ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- 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/39303/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/39303/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39302
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39302/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39302/comments
https://api.github.com/repos/huggingface/transformers/issues/39302/events
https://github.com/huggingface/transformers/issues/39302
3,215,428,472
I_kwDOCUB6oc6_p4t4
39,302
Gemma3 slightly alters hidden state when input_ids is batched
{ "login": "lwiklendt", "id": 5995363, "node_id": "MDQ6VXNlcjU5OTUzNjM=", "avatar_url": "https://avatars.githubusercontent.com/u/5995363?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lwiklendt", "html_url": "https://github.com/lwiklendt", "followers_url": "https://api.github.com/users/lwiklendt/followers", "following_url": "https://api.github.com/users/lwiklendt/following{/other_user}", "gists_url": "https://api.github.com/users/lwiklendt/gists{/gist_id}", "starred_url": "https://api.github.com/users/lwiklendt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lwiklendt/subscriptions", "organizations_url": "https://api.github.com/users/lwiklendt/orgs", "repos_url": "https://api.github.com/users/lwiklendt/repos", "events_url": "https://api.github.com/users/lwiklendt/events{/privacy}", "received_events_url": "https://api.github.com/users/lwiklendt/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-07-09T10:31:39
2025-07-10T01:31:45
2025-07-10T01:31:45
NONE
null
null
null
null
### System Info - `transformers` version: 4.50.3 - Platform: Windows-11-10.0.26100-SP0 - Python version: 3.13.2 - Huggingface_hub version: 0.30.1 - Safetensors version: 0.5.3 - Accelerate version: 1.8.1 - Accelerate config: - compute_environment: LOCAL_MACHINE - distributed_type: NO - mixed_precision: bf16 - use_cpu: False - debug: False - num_processes: 1 - machine_rank: 0 - num_machines: 1 - gpu_ids: all - rdzv_backend: static - same_network: True - main_training_function: main - enable_cpu_affinity: False - downcast_bf16: no - tpu_use_cluster: False - tpu_use_sudo: False - tpu_env: [] - DeepSpeed version: not installed - PyTorch version (GPU?): 2.6.0+cu118 (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 GeForce RTX 3090 ### 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 ```python import torch from transformers import AutoTokenizer, Gemma3ForCausalLM import torch.nn.functional as F ckpt = 'google/gemma-3-1b-pt' hf_token = None tokenizer = AutoTokenizer.from_pretrained(ckpt, token=hf_token) model = Gemma3ForCausalLM.from_pretrained( ckpt, torch_dtype=torch.bfloat16, device_map='auto', token=hf_token, ).model prompt = 'There is a problem where batching alters the hidden state in Gemma3' token_ids = tokenizer(prompt, return_tensors='pt')['input_ids'].to(model.device) hidden_state_single = model(token_ids, use_cache=False)['last_hidden_state'] hidden_state_batch = model(torch.concat((token_ids, token_ids)), use_cache=False)['last_hidden_state'] print(hidden_state_single[0]) print(hidden_state_batch[0]) print(torch.allclose(hidden_state_single[0], hidden_state_batch[0])) ``` prints ``` tensor([[ 0.6523, -1.8047, 0.7031, ..., -1.4375, -0.2988, -0.4707], [ 1.3359, 0.2520, -2.5156, ..., -3.1719, 1.6172, -0.9648], [ 2.0156, -3.5781, -1.2891, ..., -1.5547, -0.2246, -0.7969], ..., [ 0.0505, 0.1768, -1.1328, ..., 0.1777, -0.2246, -0.4766], [ 0.5195, -0.4102, -0.7148, ..., -0.6367, -4.2188, -0.6602], [-0.3887, -0.7188, -1.5391, ..., -0.3574, -0.6094, -3.0000]], device='cuda:0', dtype=torch.bfloat16, grad_fn=<SelectBackward0>) tensor([[ 0.6641, -1.8281, 0.6992, ..., -1.4688, -0.2988, -0.4707], [ 1.3125, 0.2041, -2.4688, ..., -3.1875, 1.6328, -0.9805], [ 2.0625, -3.5781, -1.2656, ..., -1.5547, -0.2246, -0.7773], ..., [ 0.0728, 0.1816, -1.1250, ..., 0.2188, -0.2168, -0.4648], [ 0.5391, -0.3672, -0.6836, ..., -0.6289, -4.2188, -0.6719], [-0.3574, -0.7500, -1.5078, ..., -0.3848, -0.6016, -2.9375]], device='cuda:0', dtype=torch.bfloat16, grad_fn=<SelectBackward0>) False ``` ### Expected behavior I expect `hidden_state_single[0]` to be equal to `hidden_state_batch[0]`.
{ "login": "lwiklendt", "id": 5995363, "node_id": "MDQ6VXNlcjU5OTUzNjM=", "avatar_url": "https://avatars.githubusercontent.com/u/5995363?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lwiklendt", "html_url": "https://github.com/lwiklendt", "followers_url": "https://api.github.com/users/lwiklendt/followers", "following_url": "https://api.github.com/users/lwiklendt/following{/other_user}", "gists_url": "https://api.github.com/users/lwiklendt/gists{/gist_id}", "starred_url": "https://api.github.com/users/lwiklendt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lwiklendt/subscriptions", "organizations_url": "https://api.github.com/users/lwiklendt/orgs", "repos_url": "https://api.github.com/users/lwiklendt/repos", "events_url": "https://api.github.com/users/lwiklendt/events{/privacy}", "received_events_url": "https://api.github.com/users/lwiklendt/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39302/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/39302/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/39301
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39301/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39301/comments
https://api.github.com/repos/huggingface/transformers/issues/39301/events
https://github.com/huggingface/transformers/pull/39301
3,215,288,719
PR_kwDOCUB6oc6eF2GM
39,301
[sliding window] revert and deprecate
{ "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 }
[ { "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-07-09T09:54:05
2025-07-09T14:10:38
2025-07-09T14:10:38
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39301", "html_url": "https://github.com/huggingface/transformers/pull/39301", "diff_url": "https://github.com/huggingface/transformers/pull/39301.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39301.patch", "merged_at": "2025-07-09T14:10:38" }
# What does this PR do? Fixes https://github.com/huggingface/transformers/issues/39290
{ "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/39301/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/39301/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39300
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39300/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39300/comments
https://api.github.com/repos/huggingface/transformers/issues/39300/events
https://github.com/huggingface/transformers/pull/39300
3,215,255,726
PR_kwDOCUB6oc6eFu1Q
39,300
fix: providing a tensor to cache_position in model.generate kwargs always crashes because of boolean test
{ "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-07-09T09:44:53
2025-07-31T08:42:54
2025-07-30T17:30:29
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39300", "html_url": "https://github.com/huggingface/transformers/pull/39300", "diff_url": "https://github.com/huggingface/transformers/pull/39300.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39300.patch", "merged_at": "2025-07-30T17:30:29" }
# What does this PR do? copy of #39261 -- see the discussion there for more references (I did a bad force push and bricked the 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 }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39300/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 1, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/39300/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39299
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39299/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39299/comments
https://api.github.com/repos/huggingface/transformers/issues/39299/events
https://github.com/huggingface/transformers/pull/39299
3,215,218,992
PR_kwDOCUB6oc6eFmxQ
39,299
Remove device check in HQQ quantizer
{ "login": "learning-chip", "id": 80731350, "node_id": "MDQ6VXNlcjgwNzMxMzUw", "avatar_url": "https://avatars.githubusercontent.com/u/80731350?v=4", "gravatar_id": "", "url": "https://api.github.com/users/learning-chip", "html_url": "https://github.com/learning-chip", "followers_url": "https://api.github.com/users/learning-chip/followers", "following_url": "https://api.github.com/users/learning-chip/following{/other_user}", "gists_url": "https://api.github.com/users/learning-chip/gists{/gist_id}", "starred_url": "https://api.github.com/users/learning-chip/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/learning-chip/subscriptions", "organizations_url": "https://api.github.com/users/learning-chip/orgs", "repos_url": "https://api.github.com/users/learning-chip/repos", "events_url": "https://api.github.com/users/learning-chip/events{/privacy}", "received_events_url": "https://api.github.com/users/learning-chip/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-09T09:34:04
2025-07-11T15:00:28
2025-07-11T14:59:51
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39299", "html_url": "https://github.com/huggingface/transformers/pull/39299", "diff_url": "https://github.com/huggingface/transformers/pull/39299.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39299.patch", "merged_at": "2025-07-11T14:59:51" }
Fixes https://github.com/huggingface/transformers/issues/38439 Tested on CPU and NPU, both works out-of-box. In this case, the HQQ dependency is installed by ``` DISABLE_CUDA=1 pip install git+https://github.com/mobiusml/hqq.git ``` ## Who can review? - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
{ "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/39299/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/39299/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39298
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39298/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39298/comments
https://api.github.com/repos/huggingface/transformers/issues/39298/events
https://github.com/huggingface/transformers/pull/39298
3,215,026,914
PR_kwDOCUB6oc6eE9PH
39,298
feat: support flash attn 2 in Granite MOE
{ "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 }
[]
closed
false
null
[]
null
[]
2025-07-09T08:34:05
2025-07-09T21:14:53
2025-07-09T20:07:00
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39298", "html_url": "https://github.com/huggingface/transformers/pull/39298", "diff_url": "https://github.com/huggingface/transformers/pull/39298.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39298.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 --> While the GraniteMOE model currently supports flash attention 2 (`supports_flash_attn_2 = True`) it expects the user to alter inputs when FA2 is used. This is counterintuitive and should be fixed. For context, FA2 throws an error if an attention mask is provided. The existing logic (see [here](https://github.com/huggingface/transformers/blob/1580f6465347df4e8d7c12cd4d3dc603b8a689ad/src/transformers/models/granitemoe/modeling_granitemoe.py#L778)) does not ensure that no attention mask is passed if FA2 is used. This PR fixes that. ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface, @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 --> @ArthurZucker @younesbelkada @mayank31398
{ "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 }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39298/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/39298/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39297
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39297/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39297/comments
https://api.github.com/repos/huggingface/transformers/issues/39297/events
https://github.com/huggingface/transformers/pull/39297
3,214,939,096
PR_kwDOCUB6oc6eEqmZ
39,297
Fix bug with deepspeed and accelerator args in training_args.py
{ "login": "MuyaoLi-jimo", "id": 109989534, "node_id": "U_kgDOBo5Ong", "avatar_url": "https://avatars.githubusercontent.com/u/109989534?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MuyaoLi-jimo", "html_url": "https://github.com/MuyaoLi-jimo", "followers_url": "https://api.github.com/users/MuyaoLi-jimo/followers", "following_url": "https://api.github.com/users/MuyaoLi-jimo/following{/other_user}", "gists_url": "https://api.github.com/users/MuyaoLi-jimo/gists{/gist_id}", "starred_url": "https://api.github.com/users/MuyaoLi-jimo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MuyaoLi-jimo/subscriptions", "organizations_url": "https://api.github.com/users/MuyaoLi-jimo/orgs", "repos_url": "https://api.github.com/users/MuyaoLi-jimo/repos", "events_url": "https://api.github.com/users/MuyaoLi-jimo/events{/privacy}", "received_events_url": "https://api.github.com/users/MuyaoLi-jimo/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-07-09T08:02:01
2025-07-11T16:34:42
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39297", "html_url": "https://github.com/huggingface/transformers/pull/39297", "diff_url": "https://github.com/huggingface/transformers/pull/39297.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39297.patch", "merged_at": null }
### System Info - transformers version: 4.54.0.dev0 - Platform: Linux-5.4.119-19.0009.28-x86_64-with-glibc2.31 - Python version: 3.10.16 - Huggingface_hub version: 0.31.1 - Safetensors version: 0.4.5 - Accelerate version: 0.22.0.dev0 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 GPU in script?: T Using distributed or parallel set-up in script?: T ### Who can help? @SunMarc and @qgallouedec ### 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 Right now any command with --deepspeed /path/to/json will fail and throw the following error `--deepspeed: invalid Dict value` This bug has occurred before and was previously fixed in [#24974](https://github.com/huggingface/transformers/pull/24974), but unfortunately, it’s broken again. The root cause seems to be that Python’s dataclass fields do not support Union[str, dict] when parsed from the CLI. ### Expected behavior deepspeed flag should support string.
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39297/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/39297/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39296
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39296/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39296/comments
https://api.github.com/repos/huggingface/transformers/issues/39296/events
https://github.com/huggingface/transformers/pull/39296
3,214,860,035
PR_kwDOCUB6oc6eEZy4
39,296
no use now
{ "login": "zRzRzRzRzRzRzR", "id": 93239683, "node_id": "U_kgDOBY65gw", "avatar_url": "https://avatars.githubusercontent.com/u/93239683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zRzRzRzRzRzRzR", "html_url": "https://github.com/zRzRzRzRzRzRzR", "followers_url": "https://api.github.com/users/zRzRzRzRzRzRzR/followers", "following_url": "https://api.github.com/users/zRzRzRzRzRzRzR/following{/other_user}", "gists_url": "https://api.github.com/users/zRzRzRzRzRzRzR/gists{/gist_id}", "starred_url": "https://api.github.com/users/zRzRzRzRzRzRzR/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zRzRzRzRzRzRzR/subscriptions", "organizations_url": "https://api.github.com/users/zRzRzRzRzRzRzR/orgs", "repos_url": "https://api.github.com/users/zRzRzRzRzRzRzR/repos", "events_url": "https://api.github.com/users/zRzRzRzRzRzRzR/events{/privacy}", "received_events_url": "https://api.github.com/users/zRzRzRzRzRzRzR/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-09T07:33:52
2025-07-18T04:39:44
2025-07-14T15:59:04
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39296", "html_url": "https://github.com/huggingface/transformers/pull/39296", "diff_url": "https://github.com/huggingface/transformers/pull/39296.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39296.patch", "merged_at": null }
not using now.use https://github.com/huggingface/transformers/pull/39393
{ "login": "zRzRzRzRzRzRzR", "id": 93239683, "node_id": "U_kgDOBY65gw", "avatar_url": "https://avatars.githubusercontent.com/u/93239683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zRzRzRzRzRzRzR", "html_url": "https://github.com/zRzRzRzRzRzRzR", "followers_url": "https://api.github.com/users/zRzRzRzRzRzRzR/followers", "following_url": "https://api.github.com/users/zRzRzRzRzRzRzR/following{/other_user}", "gists_url": "https://api.github.com/users/zRzRzRzRzRzRzR/gists{/gist_id}", "starred_url": "https://api.github.com/users/zRzRzRzRzRzRzR/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zRzRzRzRzRzRzR/subscriptions", "organizations_url": "https://api.github.com/users/zRzRzRzRzRzRzR/orgs", "repos_url": "https://api.github.com/users/zRzRzRzRzRzRzR/repos", "events_url": "https://api.github.com/users/zRzRzRzRzRzRzR/events{/privacy}", "received_events_url": "https://api.github.com/users/zRzRzRzRzRzRzR/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39296/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/39296/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39295
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39295/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39295/comments
https://api.github.com/repos/huggingface/transformers/issues/39295/events
https://github.com/huggingface/transformers/issues/39295
3,214,790,143
I_kwDOCUB6oc6_nc3_
39,295
`quantization_method` is not cleared after calling `.dequantize()`
{ "login": "karol-szustakowski", "id": 191375020, "node_id": "U_kgDOC2gmrA", "avatar_url": "https://avatars.githubusercontent.com/u/191375020?v=4", "gravatar_id": "", "url": "https://api.github.com/users/karol-szustakowski", "html_url": "https://github.com/karol-szustakowski", "followers_url": "https://api.github.com/users/karol-szustakowski/followers", "following_url": "https://api.github.com/users/karol-szustakowski/following{/other_user}", "gists_url": "https://api.github.com/users/karol-szustakowski/gists{/gist_id}", "starred_url": "https://api.github.com/users/karol-szustakowski/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/karol-szustakowski/subscriptions", "organizations_url": "https://api.github.com/users/karol-szustakowski/orgs", "repos_url": "https://api.github.com/users/karol-szustakowski/repos", "events_url": "https://api.github.com/users/karol-szustakowski/events{/privacy}", "received_events_url": "https://api.github.com/users/karol-szustakowski/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-07-09T07:08:25
2025-07-15T15:16:11
2025-07-15T15:16:11
NONE
null
null
null
null
### System Info bitsandbytes==0.46.0 transfomers==4.51.3 Python 3.9.21 ### Who can help? @SunMarc @MekkCyber ### 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 After calling `model.dequantize()` I would expect to be able to handle the model as if it were never quantized. For example, I expected to be able to do this: ```py model = model.dequantize() model = model.to(dtype=torch.float16) ``` The above fails with the exception: ` ValueError: You cannot cast a bitsandbytes model in a new `dtype`. Make sure to load the model using `from_pretrained` using the desired `dtype` by passing the correct `torch_dtype` argument. ` ### Expected behavior The `quantization_method` should be cleared after the model is dequantized, this currently can be circumvented by: ```py model = model.dequantize() model.quantization_method = None model = model.to(dtype=torch.float16) ```
{ "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/39295/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/39295/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/39294
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39294/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39294/comments
https://api.github.com/repos/huggingface/transformers/issues/39294/events
https://github.com/huggingface/transformers/pull/39294
3,214,728,744
PR_kwDOCUB6oc6eD9o2
39,294
[flash attn 3] bring back flags
{ "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-07-09T06:45:01
2025-07-09T07:49:45
2025-07-09T07:45:01
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39294", "html_url": "https://github.com/huggingface/transformers/pull/39294", "diff_url": "https://github.com/huggingface/transformers/pull/39294.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39294.patch", "merged_at": "2025-07-09T07:45:01" }
# What does this PR do? Fixes https://github.com/huggingface/transformers/issues/39288 and brings back `_supports_flash_attn3=True` flags in all models where FA2 is supported I believe the flag was deleted by accident, but lmk if that was intended
{ "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/39294/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/39294/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39293
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39293/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39293/comments
https://api.github.com/repos/huggingface/transformers/issues/39293/events
https://github.com/huggingface/transformers/pull/39293
3,214,724,084
PR_kwDOCUB6oc6eD8mi
39,293
Add T5LA models
{ "login": "HRezaei", "id": 657216, "node_id": "MDQ6VXNlcjY1NzIxNg==", "avatar_url": "https://avatars.githubusercontent.com/u/657216?v=4", "gravatar_id": "", "url": "https://api.github.com/users/HRezaei", "html_url": "https://github.com/HRezaei", "followers_url": "https://api.github.com/users/HRezaei/followers", "following_url": "https://api.github.com/users/HRezaei/following{/other_user}", "gists_url": "https://api.github.com/users/HRezaei/gists{/gist_id}", "starred_url": "https://api.github.com/users/HRezaei/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/HRezaei/subscriptions", "organizations_url": "https://api.github.com/users/HRezaei/orgs", "repos_url": "https://api.github.com/users/HRezaei/repos", "events_url": "https://api.github.com/users/HRezaei/events{/privacy}", "received_events_url": "https://api.github.com/users/HRezaei/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-07-09T06:43:41
2025-09-19T04:31:55
null
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39293", "html_url": "https://github.com/huggingface/transformers/pull/39293", "diff_url": "https://github.com/huggingface/transformers/pull/39293.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39293.patch", "merged_at": null }
# What does this PR do? Adds the implementation of the LookAhead (LA) models. These models are designed to predict not only the next immediate token after the input prompt, but also the second, third, ... up to K next tokens. These tokens can be used to mitigate the high inference latency in generation (see [this survey](https://aclanthology.org/2024.findings-acl.456/)) or in approximated ranking of a set of responses (see [this paper](https://openreview.net/pdf?id=D38rTnrkal) for an application). ## 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
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39293/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/39293/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39292
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39292/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39292/comments
https://api.github.com/repos/huggingface/transformers/issues/39292/events
https://github.com/huggingface/transformers/pull/39292
3,214,715,282
PR_kwDOCUB6oc6eD6ps
39,292
Feat: add Kwai-Keye transformers
{ "login": "Kwai-Keye", "id": 216671074, "node_id": "U_kgDODOojYg", "avatar_url": "https://avatars.githubusercontent.com/u/216671074?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Kwai-Keye", "html_url": "https://github.com/Kwai-Keye", "followers_url": "https://api.github.com/users/Kwai-Keye/followers", "following_url": "https://api.github.com/users/Kwai-Keye/following{/other_user}", "gists_url": "https://api.github.com/users/Kwai-Keye/gists{/gist_id}", "starred_url": "https://api.github.com/users/Kwai-Keye/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Kwai-Keye/subscriptions", "organizations_url": "https://api.github.com/users/Kwai-Keye/orgs", "repos_url": "https://api.github.com/users/Kwai-Keye/repos", "events_url": "https://api.github.com/users/Kwai-Keye/events{/privacy}", "received_events_url": "https://api.github.com/users/Kwai-Keye/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-07-09T06:41:03
2025-09-22T08:36:45
2025-09-22T08:36:45
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39292", "html_url": "https://github.com/huggingface/transformers/pull/39292", "diff_url": "https://github.com/huggingface/transformers/pull/39292.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39292.patch", "merged_at": null }
Add support for Kwai-Keye/Keye-VL-8B-Preview model ## Description This pull request adds support for the Keye-VL-8B-Preview model developed by Kwai-Keye. Keye-VL-8B-Preview is an advanced vision-language model that demonstrates strong performance in video understanding, visual perception, and reasoning tasks,. The model repository can be found at: * Hugging Face Hub: [https://huggingface.co/Kw](https://huggingface.co/Kwai-Keye/Keye-VL-8B-Preview)[ai-Ke](https://huggingface.co/Kwai-Keye/Keye-VL-8B-Preview)[ye/Ke](https://huggingface.co/Kwai-Keye/Keye-VL-8B-Preview)[ye-VL](https://huggingface.co/Kwai-Keye/Keye-VL-8B-Preview)[-8B-P](https://huggingface.co/Kwai-Keye/Keye-VL-8B-Preview)[revie](https://huggingface.co/Kwai-Keye/Keye-VL-8B-Preview)[w](https://huggingface.co/Kwai-Keye/Keye-VL-8B-Preview) * GitHub: [https://github.com](https://github.com/Kwai-Keye/Keye)[/Kwai](https://github.com/Kwai-Keye/Keye)[-Keye](https://github.com/Kwai-Keye/Keye)[/Keye](https://github.com/Kwai-Keye/Keye) ## Key Changes 1. Added model configuration files for Keye-VL-8B-Preview 2. Implemented model architecture code based on the official specifications 3. Added tokenizer support for the model's specific tokenization requirements 4. Included example usage scripts in the documentation ## Model Architecture The model consists of: * A Siglip vision encoder for processing image/video inputs * A Qwen3 decoder for language understanding and generation Usage Example ``` import torch from transformers import KeyeForConditionalGeneration, AutoProcessor from PIL import Image import requests model = KeyeForConditionalGeneration.from_pretrained( "Kwai-Keye/Keye-VL-8B-Preview", torch_dtype=torch.float16, device_map="auto", attn_implementation="sdpa", trust_remote_code=True ) processor = AutoProcessor.from_pretrained("Kwai-Keye/Keye-VL-8B-Preview", trust_remote_code=True) url = "https://s1-11508.kwimgs.com/kos/nlav11508/mllm_all/ziran_jiafeimao_11.jpg" messages = [ { "role":"user", "content":[ { "type":"image", "image": url, }, { "type":"text", "text":"Describe this image." } ] } ] image_inputs = [Image.open(requests.get(url, stream=True).raw)] text = processor.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) inputs = processor( text=[text], images=image_inputs, videos=None, padding=True, return_tensors="pt", ).to(model.device) generated_ids = model.generate(**inputs, max_new_tokens=128) generated_ids_trimmed = [ out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids) ] output_text = processor.batch_decode( generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False ) print(output_text) ``` Checklist - [ ] Model code is properly formatted and follows transformers coding guidelines - [ ] Documentation is updated with usage examples - [ ] All new and existing tests pass locally with the changes We believe that integrating Keye-VL-8B-Preview into the transformers library will provide users with another powerful option for vision-language tasks. We welcome any feedback or suggestions for improving this integration.
{ "login": "Kwai-Keye", "id": 216671074, "node_id": "U_kgDODOojYg", "avatar_url": "https://avatars.githubusercontent.com/u/216671074?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Kwai-Keye", "html_url": "https://github.com/Kwai-Keye", "followers_url": "https://api.github.com/users/Kwai-Keye/followers", "following_url": "https://api.github.com/users/Kwai-Keye/following{/other_user}", "gists_url": "https://api.github.com/users/Kwai-Keye/gists{/gist_id}", "starred_url": "https://api.github.com/users/Kwai-Keye/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Kwai-Keye/subscriptions", "organizations_url": "https://api.github.com/users/Kwai-Keye/orgs", "repos_url": "https://api.github.com/users/Kwai-Keye/repos", "events_url": "https://api.github.com/users/Kwai-Keye/events{/privacy}", "received_events_url": "https://api.github.com/users/Kwai-Keye/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39292/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/39292/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39291
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39291/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39291/comments
https://api.github.com/repos/huggingface/transformers/issues/39291/events
https://github.com/huggingface/transformers/issues/39291
3,214,439,480
I_kwDOCUB6oc6_mHQ4
39,291
Support 2D Array Inputs in Wav2Vec2FeatureExtractor for Non-Waveform Modalities
{ "login": "cyberso", "id": 111082513, "node_id": "U_kgDOBp78EQ", "avatar_url": "https://avatars.githubusercontent.com/u/111082513?v=4", "gravatar_id": "", "url": "https://api.github.com/users/cyberso", "html_url": "https://github.com/cyberso", "followers_url": "https://api.github.com/users/cyberso/followers", "following_url": "https://api.github.com/users/cyberso/following{/other_user}", "gists_url": "https://api.github.com/users/cyberso/gists{/gist_id}", "starred_url": "https://api.github.com/users/cyberso/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cyberso/subscriptions", "organizations_url": "https://api.github.com/users/cyberso/orgs", "repos_url": "https://api.github.com/users/cyberso/repos", "events_url": "https://api.github.com/users/cyberso/events{/privacy}", "received_events_url": "https://api.github.com/users/cyberso/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-07-09T04:21:28
2025-08-20T08:03:02
2025-08-20T08:03:02
NONE
null
null
null
null
### System Info Transformers version: 4.17.0 Platform: Linux-5.15.0-43-generic-x86_64-with-debian-bookworm-sid Python version: 3.7.12 PyTorch version: 1.13.1+cu117 TensorFlow version: 2.11.0 Flax version: Not installed Tokenizers version: 0.13.3 HuggingFace Hub version: 0.16.4 Datasets version: 2.13.2 Is CUDA available (torch)? True GPU device name: NVIDIA GeForce GTX 1080 Ti Is GPU available (tensorflow)? True ### Who can help? speech models: @eustlb ### Information - [x] 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 `Wav2Vec2FeatureExtractor` currently only accepts input as a list of 1D NumPy arrays due to hardcoded padding logic in its base class `SequenceFeatureExtractor`. This restricts its use to raw waveform data and limits its flexibility for repurposing the model architecture for other input types (e.g., 2D spectrograms). Enhancing `Wav2Vec2FeatureExtractor` to support list of 2D NumPy arrays (e.g., shape `[featureDim, time]`) would improve its compatibility with alternative modalities and workflows, such as precomputed features or spectrograms. ``` import numpy as np from transformers import Wav2Vec2FeatureExtractor # Initialize the feature extractor feature_extractor = Wav2Vec2FeatureExtractor(sampling_rate=16000) # 1D input: (Time) β€” should be accepted waveform_1d = np.random.rand(16000) # 1 second of mono audio output = feature_extractor(waveform_1d, return_tensors="np") print("Expand the dimension to append batch") print(output['input_values'].shape) # 2D input: (Batch, Time) waveform_list = [np.random.rand(l) for l in np.random.randint(10000, 16000, size=10)] output = feature_extractor(waveform_list, return_tensors="np", padding=True) print("Consider the first dimension as batch") print(output['input_values'].shape) # 3D input: (Batch, Channels, Time) β€” should raise error waveform_3d = [np.random.rand(2, l) for l in np.random.randint(1000, 1600, size=10)] output = feature_extractor(waveform_3d, return_tensors="np", padding=True) print("Incorrectly expand the dimension to append batch") print(output['input_values'].shape) ``` 1D and list-of-1D inputs behave as expected. However, an error occurs when passing a 2D NumPy array. In this case, Wav2Vec2FeatureExtractor incorrectly interprets the feature dimension as the batch axis, leading to unintended behavior. The detailed error message is provided below. ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) ~/.conda/envs/neur_vec/lib/python3.7/site-packages/transformers/feature_extraction_utils.py in convert_to_tensors(self, tensor_type) 168 if not is_tensor(value): --> 169 tensor = as_tensor(value) 170 ValueError: could not broadcast input array from shape (2,1583) into shape (2,) During handling of the above exception, another exception occurred: ValueError Traceback (most recent call last) /tmp/ipykernel_212/846801801.py in <module> 20 # 3D input: (Batch, Channels, Time) β€” should raise error 21 waveform_3d = [np.random.rand(2, l) for l in np.random.randint(1000, 1600, size=10)] ---> 22 output = feature_extractor(waveform_3d, return_tensors="np", padding=True) 23 print("Incorrectly expand the dimension to append batch") 24 print(output['input_values'].shape) ~/.conda/envs/neur_vec/lib/python3.7/site-packages/transformers/models/wav2vec2/feature_extraction_wav2vec2.py in __call__(self, raw_speech, padding, max_length, truncation, pad_to_multiple_of, return_attention_mask, return_tensors, sampling_rate, **kwargs) 200 truncation=truncation, 201 pad_to_multiple_of=pad_to_multiple_of, --> 202 return_attention_mask=return_attention_mask, 203 ) 204 ~/.conda/envs/neur_vec/lib/python3.7/site-packages/transformers/feature_extraction_sequence_utils.py in pad(self, processed_features, padding, max_length, truncation, pad_to_multiple_of, return_attention_mask, return_tensors) 230 batch_outputs[key].append(value) 231 --> 232 return BatchFeature(batch_outputs, tensor_type=return_tensors) 233 234 def _pad( ~/.conda/envs/neur_vec/lib/python3.7/site-packages/transformers/feature_extraction_utils.py in __init__(self, data, tensor_type) 78 def __init__(self, data: Optional[Dict[str, Any]] = None, tensor_type: Union[None, str, TensorType] = None): 79 super().__init__(data) ---> 80 self.convert_to_tensors(tensor_type=tensor_type) 81 82 def __getitem__(self, item: str) -> Union[Any]: ~/.conda/envs/neur_vec/lib/python3.7/site-packages/transformers/feature_extraction_utils.py in convert_to_tensors(self, tensor_type) 174 raise ValueError("Unable to create tensor returning overflowing values of different lengths. ") 175 raise ValueError( --> 176 "Unable to create tensor, you should probably activate padding " 177 "with 'padding=True' to have batched tensors with the same length." 178 ) ValueError: Unable to create tensor, you should probably activate padding with 'padding=True' to have batched tensors with the same length. ``` ### Expected behavior 1D input: Expand the dimension to append batch (1, 16000) 2D input: Consider number of array in the list as batch, padd across trials with variable length (10, 14978) 3D input: Consider number of array in the list a as batch, padd across trials with variable length (10, 2, 14978)
{ "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/39291/reactions", "total_count": 4, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 2, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/39291/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/39290
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39290/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39290/comments
https://api.github.com/repos/huggingface/transformers/issues/39290/events
https://github.com/huggingface/transformers/issues/39290
3,214,087,656
I_kwDOCUB6oc6_kxXo
39,290
v4.53.0+ starts erroring with 'Gemma3TextConfig' object has no attribute 'sliding_window_pattern' with vLLM
{ "login": "es94129", "id": 12763339, "node_id": "MDQ6VXNlcjEyNzYzMzM5", "avatar_url": "https://avatars.githubusercontent.com/u/12763339?v=4", "gravatar_id": "", "url": "https://api.github.com/users/es94129", "html_url": "https://github.com/es94129", "followers_url": "https://api.github.com/users/es94129/followers", "following_url": "https://api.github.com/users/es94129/following{/other_user}", "gists_url": "https://api.github.com/users/es94129/gists{/gist_id}", "starred_url": "https://api.github.com/users/es94129/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/es94129/subscriptions", "organizations_url": "https://api.github.com/users/es94129/orgs", "repos_url": "https://api.github.com/users/es94129/repos", "events_url": "https://api.github.com/users/es94129/events{/privacy}", "received_events_url": "https://api.github.com/users/es94129/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-07-09T00:28:57
2025-07-15T12:16:17
2025-07-09T14:10:40
NONE
null
null
null
null
### System Info - `transformers` version: 4.53.1 - Platform: Linux-5.10.192-183.736.amzn2.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.13 - Huggingface_hub version: 0.33.2 - Safetensors version: 0.5.3 - Accelerate version: not installed - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (accelerator?): 2.6.0+cu124 (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 H100 80GB HBM3 ### Who can help? @ArthurZucker @Cyrilvallez ### Reproduction With vLLM <= 0.8.5.post1, upgrading transformers to 4.53.0 and above causes `AttributeError: 'Gemma3TextConfig' object has no attribute 'sliding_window_pattern'.`, likely because of the changes to Gemma 3 in this PR: https://github.com/huggingface/transformers/pull/37866. ```sh pip install transformers==4.53.1 # latest version, as long as >= 4.53.0 breaks pip install vllm==0.8.4 ``` ```python from vllm import LLM llm = LLM(model="google/gemma-3-12b-it") ``` <details> <summary>Error stacktrace</summary> <pre> ``` ERROR 07-08 22:51:23 [core.py:396] Traceback (most recent call last): ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/v1/engine/core.py", line 387, in run_engine_core ERROR 07-08 22:51:23 [core.py:396] engine_core = EngineCoreProc(*args, **kwargs) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/v1/engine/core.py", line 329, in __init__ ERROR 07-08 22:51:23 [core.py:396] super().__init__(vllm_config, executor_class, log_stats, ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/v1/engine/core.py", line 64, in __init__ ERROR 07-08 22:51:23 [core.py:396] self.model_executor = executor_class(vllm_config) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/executor/executor_base.py", line 52, in __init__ ERROR 07-08 22:51:23 [core.py:396] self._init_executor() ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/executor/uniproc_executor.py", line 47, in _init_executor ERROR 07-08 22:51:23 [core.py:396] self.collective_rpc("load_model") ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/executor/uniproc_executor.py", line 56, in collective_rpc ERROR 07-08 22:51:23 [core.py:396] answer = run_method(self.driver_worker, method, args, kwargs) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/utils.py", line 2456, in run_method ERROR 07-08 22:51:23 [core.py:396] return func(*args, **kwargs) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/v1/worker/gpu_worker.py", line 162, in load_model ERROR 07-08 22:51:23 [core.py:396] self.model_runner.load_model() ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/v1/worker/gpu_model_runner.py", line 1332, in load_model ERROR 07-08 22:51:23 [core.py:396] self.model = get_model(vllm_config=self.vllm_config) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/model_loader/__init__.py", line 14, in get_model ERROR 07-08 22:51:23 [core.py:396] return loader.load_model(vllm_config=vllm_config) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 452, in load_model ERROR 07-08 22:51:23 [core.py:396] model = _initialize_model(vllm_config=vllm_config) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 133, in _initialize_model ERROR 07-08 22:51:23 [core.py:396] return model_class(vllm_config=vllm_config, prefix=prefix) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/models/gemma3_mm.py", line 490, in __init__ ERROR 07-08 22:51:23 [core.py:396] self.language_model = init_vllm_registered_model( ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 286, in init_vllm_registered_model ERROR 07-08 22:51:23 [core.py:396] return _initialize_model(vllm_config=vllm_config, prefix=prefix) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 133, in _initialize_model ERROR 07-08 22:51:23 [core.py:396] return model_class(vllm_config=vllm_config, prefix=prefix) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/models/gemma3.py", line 493, in __init__ ERROR 07-08 22:51:23 [core.py:396] self.model = Gemma3Model(vllm_config=vllm_config, ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/compilation/decorators.py", line 151, in __init__ ERROR 07-08 22:51:23 [core.py:396] old_init(self, vllm_config=vllm_config, prefix=prefix, **kwargs) ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/models/gemma3.py", line 360, in __init__ ERROR 07-08 22:51:23 [core.py:396] self.start_layer, self.end_layer, self.layers = make_layers( ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 609, in make_layers ERROR 07-08 22:51:23 [core.py:396] [PPMissingLayer() for _ in range(start_layer)] + [ ERROR 07-08 22:51:23 [core.py:396] ^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 610, in <listcomp> ERROR 07-08 22:51:23 [core.py:396] maybe_offload_to_cpu(layer_fn(prefix=f"{prefix}.{idx}")) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/models/gemma3.py", line 362, in <lambda> ERROR 07-08 22:51:23 [core.py:396] lambda prefix: Gemma3DecoderLayer( ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/models/gemma3.py", line 288, in __init__ ERROR 07-08 22:51:23 [core.py:396] self.self_attn = Gemma3Attention( ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/vllm/model_executor/models/gemma3.py", line 151, in __init__ ERROR 07-08 22:51:23 [core.py:396] (layer_idx + 1) % config.sliding_window_pattern)) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] File "/root/miniconda3/envs/transformers-issue/lib/python3.11/site-packages/transformers/configuration_utils.py", line 209, in __getattribute__ ERROR 07-08 22:51:23 [core.py:396] return super().__getattribute__(key) ERROR 07-08 22:51:23 [core.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-08 22:51:23 [core.py:396] AttributeError: 'Gemma3TextConfig' object has no attribute 'sliding_window_pattern' ``` </pre> </details> Newer versions of vLLM also have quality issues particularly when upgrading transformers>=4.53.0 which are reported in https://github.com/vllm-project/vllm/issues/20341 . ### Expected behavior Should have the same behavior as transformers 4.52.4 + vLLM 0.8.4 ```python from vllm import LLM llm = LLM(model="google/gemma-3-12b-it") print(llm.generate("what is transformers")[0].outputs[0]) ``` ```python CompletionOutput(index=0, text='?>\n\nTransformers are a powerful type of neural network architecture that has revolutionized the', token_ids=[255999, 13765, 108, 214568, 659, 496, 8632, 1722, 529, 22823, 3707, 13217, 600, 815, 176839, 506], cumulative_logprob=None, logprobs=None, finish_reason=length, stop_reason=None) ```
{ "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/39290/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/39290/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/39289
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39289/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39289/comments
https://api.github.com/repos/huggingface/transformers/issues/39289/events
https://github.com/huggingface/transformers/pull/39289
3,213,908,523
PR_kwDOCUB6oc6eBQEf
39,289
Fix broken SAM after #39120
{ "login": "yonigozlan", "id": 74535834, "node_id": "MDQ6VXNlcjc0NTM1ODM0", "avatar_url": "https://avatars.githubusercontent.com/u/74535834?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yonigozlan", "html_url": "https://github.com/yonigozlan", "followers_url": "https://api.github.com/users/yonigozlan/followers", "following_url": "https://api.github.com/users/yonigozlan/following{/other_user}", "gists_url": "https://api.github.com/users/yonigozlan/gists{/gist_id}", "starred_url": "https://api.github.com/users/yonigozlan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yonigozlan/subscriptions", "organizations_url": "https://api.github.com/users/yonigozlan/orgs", "repos_url": "https://api.github.com/users/yonigozlan/repos", "events_url": "https://api.github.com/users/yonigozlan/events{/privacy}", "received_events_url": "https://api.github.com/users/yonigozlan/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T22:24:47
2025-07-09T21:46:22
2025-07-09T21:46:22
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39289", "html_url": "https://github.com/huggingface/transformers/pull/39289", "diff_url": "https://github.com/huggingface/transformers/pull/39289.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39289.patch", "merged_at": "2025-07-09T21:46:22" }
Was going crazy with tests failing on Sam2 after merging with main, turns out there's a typo in SAM after https://github.com/huggingface/transformers/pull/39120 Cc @ArthurZucker
{ "login": "yonigozlan", "id": 74535834, "node_id": "MDQ6VXNlcjc0NTM1ODM0", "avatar_url": "https://avatars.githubusercontent.com/u/74535834?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yonigozlan", "html_url": "https://github.com/yonigozlan", "followers_url": "https://api.github.com/users/yonigozlan/followers", "following_url": "https://api.github.com/users/yonigozlan/following{/other_user}", "gists_url": "https://api.github.com/users/yonigozlan/gists{/gist_id}", "starred_url": "https://api.github.com/users/yonigozlan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yonigozlan/subscriptions", "organizations_url": "https://api.github.com/users/yonigozlan/orgs", "repos_url": "https://api.github.com/users/yonigozlan/repos", "events_url": "https://api.github.com/users/yonigozlan/events{/privacy}", "received_events_url": "https://api.github.com/users/yonigozlan/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39289/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/39289/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39288
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39288/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39288/comments
https://api.github.com/repos/huggingface/transformers/issues/39288/events
https://github.com/huggingface/transformers/issues/39288
3,213,849,026
I_kwDOCUB6oc6_j3HC
39,288
flash_attention_3 for Qwen2_5_VisionTransformerPretrainedModel
{ "login": "aidando73", "id": 43259657, "node_id": "MDQ6VXNlcjQzMjU5NjU3", "avatar_url": "https://avatars.githubusercontent.com/u/43259657?v=4", "gravatar_id": "", "url": "https://api.github.com/users/aidando73", "html_url": "https://github.com/aidando73", "followers_url": "https://api.github.com/users/aidando73/followers", "following_url": "https://api.github.com/users/aidando73/following{/other_user}", "gists_url": "https://api.github.com/users/aidando73/gists{/gist_id}", "starred_url": "https://api.github.com/users/aidando73/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/aidando73/subscriptions", "organizations_url": "https://api.github.com/users/aidando73/orgs", "repos_url": "https://api.github.com/users/aidando73/repos", "events_url": "https://api.github.com/users/aidando73/events{/privacy}", "received_events_url": "https://api.github.com/users/aidando73/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-07-08T21:46:24
2025-07-10T05:50:08
2025-07-09T07:45:04
NONE
null
null
null
null
### Feature request As per title ### Motivation Would like better performance. ### Your contribution Let me know if you need any more details
{ "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/39288/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/39288/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/39287
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39287/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39287/comments
https://api.github.com/repos/huggingface/transformers/issues/39287/events
https://github.com/huggingface/transformers/pull/39287
3,213,818,732
PR_kwDOCUB6oc6eA8xm
39,287
feat: add support for gradient checkpointing for TimmWrapperModel and TimmWrapperForImageClassification
{ "login": "Yozer", "id": 9254709, "node_id": "MDQ6VXNlcjkyNTQ3MDk=", "avatar_url": "https://avatars.githubusercontent.com/u/9254709?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Yozer", "html_url": "https://github.com/Yozer", "followers_url": "https://api.github.com/users/Yozer/followers", "following_url": "https://api.github.com/users/Yozer/following{/other_user}", "gists_url": "https://api.github.com/users/Yozer/gists{/gist_id}", "starred_url": "https://api.github.com/users/Yozer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Yozer/subscriptions", "organizations_url": "https://api.github.com/users/Yozer/orgs", "repos_url": "https://api.github.com/users/Yozer/repos", "events_url": "https://api.github.com/users/Yozer/events{/privacy}", "received_events_url": "https://api.github.com/users/Yozer/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T21:29:13
2025-07-22T11:08:26
2025-07-22T11:07:52
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39287", "html_url": "https://github.com/huggingface/transformers/pull/39287", "diff_url": "https://github.com/huggingface/transformers/pull/39287.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39287.patch", "merged_at": "2025-07-22T11:07:52" }
# What does this PR do? This enables gradient checkpointing for timm wrapped models. ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [x] Did you write any new necessary tests? ## Who can review? @qubvel
{ "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/39287/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/39287/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39286
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39286/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39286/comments
https://api.github.com/repos/huggingface/transformers/issues/39286/events
https://github.com/huggingface/transformers/pull/39286
3,213,804,648
PR_kwDOCUB6oc6eA5tv
39,286
Fix bugs in pytorch example run_clm when streaming is enabled
{ "login": "HRezaei", "id": 657216, "node_id": "MDQ6VXNlcjY1NzIxNg==", "avatar_url": "https://avatars.githubusercontent.com/u/657216?v=4", "gravatar_id": "", "url": "https://api.github.com/users/HRezaei", "html_url": "https://github.com/HRezaei", "followers_url": "https://api.github.com/users/HRezaei/followers", "following_url": "https://api.github.com/users/HRezaei/following{/other_user}", "gists_url": "https://api.github.com/users/HRezaei/gists{/gist_id}", "starred_url": "https://api.github.com/users/HRezaei/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/HRezaei/subscriptions", "organizations_url": "https://api.github.com/users/HRezaei/orgs", "repos_url": "https://api.github.com/users/HRezaei/repos", "events_url": "https://api.github.com/users/HRezaei/events{/privacy}", "received_events_url": "https://api.github.com/users/HRezaei/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T21:21:15
2025-07-16T06:26:23
2025-07-15T13:37:28
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39286", "html_url": "https://github.com/huggingface/transformers/pull/39286", "diff_url": "https://github.com/huggingface/transformers/pull/39286.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39286.patch", "merged_at": "2025-07-15T13:37:28" }
# What does this PR do? Fixes #39285 ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [x] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? @ArthurZucker @sgugger
{ "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/39286/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/39286/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39285
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39285/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39285/comments
https://api.github.com/repos/huggingface/transformers/issues/39285/events
https://github.com/huggingface/transformers/issues/39285
3,213,782,871
I_kwDOCUB6oc6_jm9X
39,285
Pytorch language_modelling example run_clm fails when streaming is enabled
{ "login": "HRezaei", "id": 657216, "node_id": "MDQ6VXNlcjY1NzIxNg==", "avatar_url": "https://avatars.githubusercontent.com/u/657216?v=4", "gravatar_id": "", "url": "https://api.github.com/users/HRezaei", "html_url": "https://github.com/HRezaei", "followers_url": "https://api.github.com/users/HRezaei/followers", "following_url": "https://api.github.com/users/HRezaei/following{/other_user}", "gists_url": "https://api.github.com/users/HRezaei/gists{/gist_id}", "starred_url": "https://api.github.com/users/HRezaei/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/HRezaei/subscriptions", "organizations_url": "https://api.github.com/users/HRezaei/orgs", "repos_url": "https://api.github.com/users/HRezaei/repos", "events_url": "https://api.github.com/users/HRezaei/events{/privacy}", "received_events_url": "https://api.github.com/users/HRezaei/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-07-08T21:09:40
2025-07-15T13:37:29
2025-07-15T13:37:29
CONTRIBUTOR
null
null
null
null
### System Info - `transformers` version: 4.53.0.dev0 - Platform: macOS-15.5-arm64-arm-64bit - Python version: 3.10.16 - Huggingface_hub version: 0.30.0 - Safetensors version: 0.5.2 - Accelerate version: 1.8.1 - Accelerate config: not found - DeepSpeed version: not installed - PyTorch version (accelerator?): 2.5.1 (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?: No ### Who can help? @ArthurZucker @sgugger ### 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 Run the example file: `examples/pytorch/language-modeling/run_clm.py` with the argument `--streaming` enabled: 1. Clone the repository 2. Install transformers from source, `cd transformers && pip install .` 3. For instance, run the command below: ```shell python examples/pytorch/language-modeling/run_clm.py --model_type gpt2 \ --tokenizer_name openai-community/gpt2 --dataset_name=HuggingFaceFW/fineweb \ --dataset_config_name=sample-350BT --streaming True --do_train --do_eval \ --overwrite_output_dir --max_steps=100 --max_train_samples=2000 --max_eval_samples=1000 \ --output_dir=/tmp/gpt2TestClm ``` 3. You will see an error like `ValueError: Bad split: train[:5%]. Available splits: ['train']` That's because in streaming mode, range splits are not available. Also there are other bugs like running `len(train_dataset)` which raises an error if the dataset is in streaming mode. [Here](https://colab.research.google.com/drive/10AhU2vT1QfTfHCRM2kdxEsu6ofpPICJq?usp=sharing) is a colab notebook to see the issue in action. ### Expected behavior It is expected to pre-train a GPT2 model from scratch using the dataset in streaming mode I'm working on a [PR](https://github.com/huggingface/transformers/pull/39286) that fixes this issue.
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39285/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/39285/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/39284
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39284/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39284/comments
https://api.github.com/repos/huggingface/transformers/issues/39284/events
https://github.com/huggingface/transformers/pull/39284
3,213,347,995
PR_kwDOCUB6oc6d_Wn4
39,284
Bump transformers from 4.48.0 to 4.52.1 in /examples/tensorflow/language-modeling-tpu
{ "login": "dependabot[bot]", "id": 49699333, "node_id": "MDM6Qm90NDk2OTkzMzM=", "avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dependabot%5Bbot%5D", "html_url": "https://github.com/apps/dependabot", "followers_url": "https://api.github.com/users/dependabot%5Bbot%5D/followers", "following_url": "https://api.github.com/users/dependabot%5Bbot%5D/following{/other_user}", "gists_url": "https://api.github.com/users/dependabot%5Bbot%5D/gists{/gist_id}", "starred_url": "https://api.github.com/users/dependabot%5Bbot%5D/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dependabot%5Bbot%5D/subscriptions", "organizations_url": "https://api.github.com/users/dependabot%5Bbot%5D/orgs", "repos_url": "https://api.github.com/users/dependabot%5Bbot%5D/repos", "events_url": "https://api.github.com/users/dependabot%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/dependabot%5Bbot%5D/received_events", "type": "Bot", "user_view_type": "public", "site_admin": false }
[ { "id": 1905493434, "node_id": "MDU6TGFiZWwxOTA1NDkzNDM0", "url": "https://api.github.com/repos/huggingface/transformers/labels/dependencies", "name": "dependencies", "color": "0366d6", "default": false, "description": "Pull requests that update a dependency file" }, { "id": 6410654816, "node_id": "LA_kwDOCUB6oc8AAAABfhrUYA", "url": "https://api.github.com/repos/huggingface/transformers/labels/python", "name": "python", "color": "2b67c6", "default": false, "description": "Pull requests that update Python code" } ]
closed
false
null
[]
null
[]
2025-07-08T18:00:36
2025-08-07T11:15:01
2025-08-07T11:14:59
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39284", "html_url": "https://github.com/huggingface/transformers/pull/39284", "diff_url": "https://github.com/huggingface/transformers/pull/39284.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39284.patch", "merged_at": null }
Bumps [transformers](https://github.com/huggingface/transformers) from 4.48.0 to 4.52.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/huggingface/transformers/releases">transformers's releases</a>.</em></p> <blockquote> <h2>Patch release v4.51.3</h2> <p>A mix of bugs were fixed in this patch; very exceptionally, we diverge from semantic versioning to merge GLM-4 in this patch release.</p> <ul> <li>Handle torch ver in flexattn (<a href="https://redirect.github.com/huggingface/transformers/issues/37400">#37400</a>)</li> <li>handle torch version edge cases (<a href="https://redirect.github.com/huggingface/transformers/issues/37399">#37399</a>)</li> <li>Add glm4 (<a href="https://redirect.github.com/huggingface/transformers/issues/37388">#37388</a>)</li> </ul> <h1>Patch Release 4.51.2</h1> <p>This is another round of bug fixes, but they are a lot more minor and outputs were not really affected!</p> <ul> <li>Fix Llama4 offset (<a href="https://redirect.github.com/huggingface/transformers/issues/37414">#37414</a>) by <a href="https://github.com/Cyrilvallez"><code>@​Cyrilvallez</code></a></li> <li>Attention Quantization with FBGemm &amp; TP (<a href="https://redirect.github.com/huggingface/transformers/issues/37384">#37384</a>) by <a href="https://github.com/MekkCyber"><code>@​MekkCyber</code></a></li> <li>use rms_norm_eps for the L2Norm for Llama4 (<a href="https://redirect.github.com/huggingface/transformers/issues/37418">#37418</a>) by <a href="https://github.com/danielhanchen"><code>@​danielhanchen</code></a></li> <li>mark llama4 as not supported with fa2 (<a href="https://redirect.github.com/huggingface/transformers/issues/37416">#37416</a>) by <a href="https://github.com/winglian"><code>@​winglian</code></a></li> </ul> <h1>Patch release v4.51.1</h1> <p>Since the release of Llama 4, we have fixed a few issues that we are now releasing in patch v4.51.1</p> <ul> <li>Fixing flex attention for torch=2.6.0 (<a href="https://redirect.github.com/huggingface/transformers/issues/37285">#37285</a>)</li> <li>more fixes for post-training llama4 (<a href="https://redirect.github.com/huggingface/transformers/issues/37329">#37329</a>)</li> <li>Remove HQQ from caching allocator warmup (<a href="https://redirect.github.com/huggingface/transformers/issues/37347">#37347</a>)</li> <li>fix derived berts _init_weights (<a href="https://redirect.github.com/huggingface/transformers/issues/37341">#37341</a>)</li> <li>Fix init empty weights without accelerate (<a href="https://redirect.github.com/huggingface/transformers/issues/37337">#37337</a>)</li> <li>Fix deepspeed with quantization (<a href="https://redirect.github.com/huggingface/transformers/issues/37324">#37324</a>)</li> <li>fix llama4 training (<a href="https://redirect.github.com/huggingface/transformers/issues/37319">#37319</a>)</li> <li>fix flex attn when optional args aren't passed (<a href="https://redirect.github.com/huggingface/transformers/issues/37327">#37327</a>)</li> <li>Multiple llama4 fixe (<a href="https://redirect.github.com/huggingface/transformers/issues/37353">#37353</a>)</li> </ul> <p>Thanks all for your patience</p> <h2>v4.51.0: Llama 4, Phi4-Multimodal, DeepSeek-v3, Qwen3</h2> <h2>New Model Additions</h2> <h3>Llama 4</h3> <p><img src="https://github.com/user-attachments/assets/d613b292-94b0-4902-9dc7-2d00693222e4" alt="image" /></p> <p>Llama 4, developed by Meta, introduces a new auto-regressive Mixture-of-Experts (MoE) architecture.This generation includes two models:</p> <ul> <li>The highly capable Llama 4 Maverick with 17B active parameters out of ~400B total, with 128 experts.</li> <li>The efficient Llama 4 Scout also has 17B active parameters out of ~109B total, using just 16 experts.</li> </ul> <p>Both models leverage early fusion for native multimodality, enabling them to process text and image inputs. Maverick and Scout are both trained on up to 40 trillion tokens on data encompassing 200 languages (with specific fine-tuning support for 12 languages including Arabic, Spanish, German, and Hindi).</p> <p>For deployment, Llama 4 Scout is designed for accessibility, fitting on a single server-grade GPU via on-the-fly 4-bit or 8-bit quantization, while Maverick is available in BF16 and FP8 formats. These models are released under the custom Llama 4 Community License Agreement, available on the model repositories</p> <p>Getting started with Llama 4 using transformers is straightforward. Make sure you have transformers v4.51.0 or later installed:</p> <pre><code>pip install -U transformers[hf_xet] &lt;/tr&gt;&lt;/table&gt; </code></pre> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/huggingface/transformers/commit/945727948c1143a10ac6f7d811aa58bb0d126b5b"><code>9457279</code></a> Release: v4.52.1</li> <li><a href="https://github.com/huggingface/transformers/commit/eaa301673a0a7a1a8c5d3f11c046d1592a7ae16b"><code>eaa3016</code></a> Revert parallelism temporarily (<a href="https://redirect.github.com/huggingface/transformers/issues/38240">#38240</a>)</li> <li><a href="https://github.com/huggingface/transformers/commit/b5f494632c0fff2527dd3140423408644a9b0076"><code>b5f4946</code></a> Protect ParallelInterface</li> <li><a href="https://github.com/huggingface/transformers/commit/113424bcd53b92600f77d82f48add0a60fb41556"><code>113424b</code></a> Release: v4.52.0</li> <li><a href="https://github.com/huggingface/transformers/commit/f834d368f6a21ed54188d9c96fbb9013b1d2c75f"><code>f834d36</code></a> [gemma3] fix bidirectional attention mask (<a href="https://redirect.github.com/huggingface/transformers/issues/38080">#38080</a>)</li> <li><a href="https://github.com/huggingface/transformers/commit/2edb0e4b4dda8172d5628ca7497a4125f28bf6fc"><code>2edb0e4</code></a> [mllama] fix loading and inference (<a href="https://redirect.github.com/huggingface/transformers/issues/38223">#38223</a>)</li> <li><a href="https://github.com/huggingface/transformers/commit/390f153469dfdc793e7a9c7eb4822ea76f4f796a"><code>390f153</code></a> Add padding-free to bamba (<a href="https://redirect.github.com/huggingface/transformers/issues/35861">#35861</a>)</li> <li><a href="https://github.com/huggingface/transformers/commit/2a79471318a9b7b16706f3bb5cd833c7e81919a6"><code>2a79471</code></a> Fixing Bitnet after use_rms_norm introduction (<a href="https://redirect.github.com/huggingface/transformers/issues/38229">#38229</a>)</li> <li><a href="https://github.com/huggingface/transformers/commit/9661896083c9d983341afa45cc4b84af01706e72"><code>9661896</code></a> Enable Quantize KV Cache for Mistral Model (<a href="https://redirect.github.com/huggingface/transformers/issues/35042">#35042</a>)</li> <li><a href="https://github.com/huggingface/transformers/commit/1c2f36b480e02c9027d2523746d34e27b39e01a4"><code>1c2f36b</code></a> parallelism goes brrr (<a href="https://redirect.github.com/huggingface/transformers/issues/37877">#37877</a>)</li> <li>Additional commits viewable in <a href="https://github.com/huggingface/transformers/compare/v4.48.0...v4.52.1">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=transformers&package-manager=pip&previous-version=4.48.0&new-version=4.52.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/huggingface/transformers/network/alerts). </details>
{ "login": "dependabot[bot]", "id": 49699333, "node_id": "MDM6Qm90NDk2OTkzMzM=", "avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dependabot%5Bbot%5D", "html_url": "https://github.com/apps/dependabot", "followers_url": "https://api.github.com/users/dependabot%5Bbot%5D/followers", "following_url": "https://api.github.com/users/dependabot%5Bbot%5D/following{/other_user}", "gists_url": "https://api.github.com/users/dependabot%5Bbot%5D/gists{/gist_id}", "starred_url": "https://api.github.com/users/dependabot%5Bbot%5D/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dependabot%5Bbot%5D/subscriptions", "organizations_url": "https://api.github.com/users/dependabot%5Bbot%5D/orgs", "repos_url": "https://api.github.com/users/dependabot%5Bbot%5D/repos", "events_url": "https://api.github.com/users/dependabot%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/dependabot%5Bbot%5D/received_events", "type": "Bot", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39284/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/39284/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39283
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39283/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39283/comments
https://api.github.com/repos/huggingface/transformers/issues/39283/events
https://github.com/huggingface/transformers/pull/39283
3,213,325,013
PR_kwDOCUB6oc6d_Rpc
39,283
fix: clarify pooled output logic in SigLIP2
{ "login": "sameerajashyam", "id": 79054143, "node_id": "MDQ6VXNlcjc5MDU0MTQz", "avatar_url": "https://avatars.githubusercontent.com/u/79054143?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sameerajashyam", "html_url": "https://github.com/sameerajashyam", "followers_url": "https://api.github.com/users/sameerajashyam/followers", "following_url": "https://api.github.com/users/sameerajashyam/following{/other_user}", "gists_url": "https://api.github.com/users/sameerajashyam/gists{/gist_id}", "starred_url": "https://api.github.com/users/sameerajashyam/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sameerajashyam/subscriptions", "organizations_url": "https://api.github.com/users/sameerajashyam/orgs", "repos_url": "https://api.github.com/users/sameerajashyam/repos", "events_url": "https://api.github.com/users/sameerajashyam/events{/privacy}", "received_events_url": "https://api.github.com/users/sameerajashyam/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T17:50:33
2025-07-14T09:24:08
2025-07-11T10:43:05
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39283", "html_url": "https://github.com/huggingface/transformers/pull/39283", "diff_url": "https://github.com/huggingface/transformers/pull/39283.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39283.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 - [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 --> Clarified misleading comment in `modeling_siglip2.py` regarding pooled output token position. Updated the comment to reflect that the final token may be `<pad>` or `<eos>`, consistent with SigLIP2’s training (which does not use attention masks). - Adjusted the `_no_split_modules` list to match Hugging Face's modular formatting guidelines. - Verified consistency using `check_modular_conversion.py`. #39269
{ "login": "sameerajashyam", "id": 79054143, "node_id": "MDQ6VXNlcjc5MDU0MTQz", "avatar_url": "https://avatars.githubusercontent.com/u/79054143?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sameerajashyam", "html_url": "https://github.com/sameerajashyam", "followers_url": "https://api.github.com/users/sameerajashyam/followers", "following_url": "https://api.github.com/users/sameerajashyam/following{/other_user}", "gists_url": "https://api.github.com/users/sameerajashyam/gists{/gist_id}", "starred_url": "https://api.github.com/users/sameerajashyam/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sameerajashyam/subscriptions", "organizations_url": "https://api.github.com/users/sameerajashyam/orgs", "repos_url": "https://api.github.com/users/sameerajashyam/repos", "events_url": "https://api.github.com/users/sameerajashyam/events{/privacy}", "received_events_url": "https://api.github.com/users/sameerajashyam/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39283/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/39283/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39282
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39282/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39282/comments
https://api.github.com/repos/huggingface/transformers/issues/39282/events
https://github.com/huggingface/transformers/pull/39282
3,213,319,981
PR_kwDOCUB6oc6d_QiI
39,282
Fix: qwen2vl Position Id create_causal_mask dimension
{ "login": "jeffrey-dot-li", "id": 46302202, "node_id": "MDQ6VXNlcjQ2MzAyMjAy", "avatar_url": "https://avatars.githubusercontent.com/u/46302202?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jeffrey-dot-li", "html_url": "https://github.com/jeffrey-dot-li", "followers_url": "https://api.github.com/users/jeffrey-dot-li/followers", "following_url": "https://api.github.com/users/jeffrey-dot-li/following{/other_user}", "gists_url": "https://api.github.com/users/jeffrey-dot-li/gists{/gist_id}", "starred_url": "https://api.github.com/users/jeffrey-dot-li/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jeffrey-dot-li/subscriptions", "organizations_url": "https://api.github.com/users/jeffrey-dot-li/orgs", "repos_url": "https://api.github.com/users/jeffrey-dot-li/repos", "events_url": "https://api.github.com/users/jeffrey-dot-li/events{/privacy}", "received_events_url": "https://api.github.com/users/jeffrey-dot-li/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T17:48:17
2025-07-24T18:34:29
2025-07-24T18:34:29
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39282", "html_url": "https://github.com/huggingface/transformers/pull/39282", "diff_url": "https://github.com/huggingface/transformers/pull/39282.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39282.patch", "merged_at": null }
# What does this PR do? Fixes qwen2vl position id tensor for create_causal_mask. Qwen2VL uses a 3d embedding system for [time, x, y] dimensions, however `create_causal_mask` expects a 1d position id and will cause errors in this line https://github.com/huggingface/transformers/blob/0cf27916f09a1a99af55ef4f2f3e8675372f38b6/src/transformers/masking_utils.py#L709 if it is given a 3d position id. This just uses position_id[0] for creating the causal mask. <!-- 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 --> ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**. Please tag fewer than 3 people. Models: - text models: @ArthurZucker - vision models: @amyeroberts, @qubvel - speech models: @eustlb - graph models: @clefourrier Library: - flax: @gante and @Rocketknight1 - generate: @zucchini-nlp (visual-language models) or @gante (all others) - pipelines: @Rocketknight1 - tensorflow: @gante and @Rocketknight1 - tokenizers: @ArthurZucker - trainer: @zach-huggingface, @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": "jeffrey-dot-li", "id": 46302202, "node_id": "MDQ6VXNlcjQ2MzAyMjAy", "avatar_url": "https://avatars.githubusercontent.com/u/46302202?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jeffrey-dot-li", "html_url": "https://github.com/jeffrey-dot-li", "followers_url": "https://api.github.com/users/jeffrey-dot-li/followers", "following_url": "https://api.github.com/users/jeffrey-dot-li/following{/other_user}", "gists_url": "https://api.github.com/users/jeffrey-dot-li/gists{/gist_id}", "starred_url": "https://api.github.com/users/jeffrey-dot-li/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jeffrey-dot-li/subscriptions", "organizations_url": "https://api.github.com/users/jeffrey-dot-li/orgs", "repos_url": "https://api.github.com/users/jeffrey-dot-li/repos", "events_url": "https://api.github.com/users/jeffrey-dot-li/events{/privacy}", "received_events_url": "https://api.github.com/users/jeffrey-dot-li/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39282/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/39282/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39281
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39281/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39281/comments
https://api.github.com/repos/huggingface/transformers/issues/39281/events
https://github.com/huggingface/transformers/pull/39281
3,213,167,424
PR_kwDOCUB6oc6d-vSs
39,281
[Tests] Update model_id in AIMv2 Tests
{ "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 }
[]
closed
false
null
[]
null
[]
2025-07-08T16:45:37
2025-07-08T19:46:32
2025-07-08T19:46:32
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39281", "html_url": "https://github.com/huggingface/transformers/pull/39281", "diff_url": "https://github.com/huggingface/transformers/pull/39281.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39281.patch", "merged_at": "2025-07-08T19:46:32" }
As per the title, updates model_id in Aimv2 integration tests with that of official ones as the PRs for HF compatible weights are merged.
{ "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/39281/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/39281/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39280
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39280/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39280/comments
https://api.github.com/repos/huggingface/transformers/issues/39280/events
https://github.com/huggingface/transformers/pull/39280
3,212,970,597
PR_kwDOCUB6oc6d-E4-
39,280
[Core] [Offloading] Fix saving offloaded submodules
{ "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-07-08T15:29:23
2025-07-16T12:27:05
2025-07-16T08:44:41
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39280", "html_url": "https://github.com/huggingface/transformers/pull/39280", "diff_url": "https://github.com/huggingface/transformers/pull/39280.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39280.patch", "merged_at": "2025-07-16T08:44:40" }
## Purpose ## * Fixes issue with saving offloaded modules with offloaded submodules whose parent is also offloaded * Sometimes `get_state_dict_from_offload` will update the state dict with meta tensors, since `align_module_device` only aligns direct parameters, not submodule parameters. If these submodule parameters are offloaded, they will be returned as meta tensors * This fix is useful for models with finer-grained offloading as well as registering offloadable submodules such as transforms ## Changes ## * This change attempts to load the shard state dict if either the entry is empty ("") or if the entry is a meta tensor (returned by a parent which does not place submodules) ## Testing ## * Added test fails on main but succeeds with these changes
{ "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/39280/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/39280/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39279
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39279/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39279/comments
https://api.github.com/repos/huggingface/transformers/issues/39279/events
https://github.com/huggingface/transformers/pull/39279
3,212,859,545
PR_kwDOCUB6oc6d9s5p
39,279
docs: clarify pooled_output behavior in SigLIP2
{ "login": "sameerajashyam", "id": 79054143, "node_id": "MDQ6VXNlcjc5MDU0MTQz", "avatar_url": "https://avatars.githubusercontent.com/u/79054143?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sameerajashyam", "html_url": "https://github.com/sameerajashyam", "followers_url": "https://api.github.com/users/sameerajashyam/followers", "following_url": "https://api.github.com/users/sameerajashyam/following{/other_user}", "gists_url": "https://api.github.com/users/sameerajashyam/gists{/gist_id}", "starred_url": "https://api.github.com/users/sameerajashyam/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sameerajashyam/subscriptions", "organizations_url": "https://api.github.com/users/sameerajashyam/orgs", "repos_url": "https://api.github.com/users/sameerajashyam/repos", "events_url": "https://api.github.com/users/sameerajashyam/events{/privacy}", "received_events_url": "https://api.github.com/users/sameerajashyam/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T14:54:31
2025-07-08T16:31:48
2025-07-08T15:29:00
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39279", "html_url": "https://github.com/huggingface/transformers/pull/39279", "diff_url": "https://github.com/huggingface/transformers/pull/39279.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39279.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 - [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": "sameerajashyam", "id": 79054143, "node_id": "MDQ6VXNlcjc5MDU0MTQz", "avatar_url": "https://avatars.githubusercontent.com/u/79054143?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sameerajashyam", "html_url": "https://github.com/sameerajashyam", "followers_url": "https://api.github.com/users/sameerajashyam/followers", "following_url": "https://api.github.com/users/sameerajashyam/following{/other_user}", "gists_url": "https://api.github.com/users/sameerajashyam/gists{/gist_id}", "starred_url": "https://api.github.com/users/sameerajashyam/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sameerajashyam/subscriptions", "organizations_url": "https://api.github.com/users/sameerajashyam/orgs", "repos_url": "https://api.github.com/users/sameerajashyam/repos", "events_url": "https://api.github.com/users/sameerajashyam/events{/privacy}", "received_events_url": "https://api.github.com/users/sameerajashyam/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39279/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/39279/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39278
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39278/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39278/comments
https://api.github.com/repos/huggingface/transformers/issues/39278/events
https://github.com/huggingface/transformers/pull/39278
3,212,842,009
PR_kwDOCUB6oc6d9pEv
39,278
[wip, experiment] parallel mdx doc builder
{ "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-07-08T14:48:51
2025-08-19T09:24:24
2025-08-19T09:24:24
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39278", "html_url": "https://github.com/huggingface/transformers/pull/39278", "diff_url": "https://github.com/huggingface/transformers/pull/39278.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39278.patch", "merged_at": null }
# What does this PR do?
{ "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/39278/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/39278/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39277
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39277/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39277/comments
https://api.github.com/repos/huggingface/transformers/issues/39277/events
https://github.com/huggingface/transformers/pull/39277
3,212,619,683
PR_kwDOCUB6oc6d84bU
39,277
fix `aria` 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-07-08T13:42:35
2025-07-09T11:49:35
2025-07-09T11:49:33
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39277", "html_url": "https://github.com/huggingface/transformers/pull/39277", "diff_url": "https://github.com/huggingface/transformers/pull/39277.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39277.patch", "merged_at": "2025-07-09T11:49:33" }
# What does this PR do?
{ "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/39277/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/39277/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39276
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39276/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39276/comments
https://api.github.com/repos/huggingface/transformers/issues/39276/events
https://github.com/huggingface/transformers/pull/39276
3,212,417,441
PR_kwDOCUB6oc6d8MKf
39,276
fix flaky `test_generate_compile_model_forward`
{ "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-07-08T12:46:03
2025-07-08T13:36:07
2025-07-08T13:36:05
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39276", "html_url": "https://github.com/huggingface/transformers/pull/39276", "diff_url": "https://github.com/huggingface/transformers/pull/39276.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39276.patch", "merged_at": "2025-07-08T13:36:05" }
# What does this PR do? Found it flaky today in https://app.circleci.com/jobs/github/huggingface/transformers/1816845 (7 failed in a run of 5000 times) After this PR, all 5000 runs pass
{ "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/39276/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/39276/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39275
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39275/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39275/comments
https://api.github.com/repos/huggingface/transformers/issues/39275/events
https://github.com/huggingface/transformers/issues/39275
3,212,211,135
I_kwDOCUB6oc6_dnO_
39,275
hangs during training using deepspeed
{ "login": "mxjmtxrm", "id": 167944756, "node_id": "U_kgDOCgKiNA", "avatar_url": "https://avatars.githubusercontent.com/u/167944756?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mxjmtxrm", "html_url": "https://github.com/mxjmtxrm", "followers_url": "https://api.github.com/users/mxjmtxrm/followers", "following_url": "https://api.github.com/users/mxjmtxrm/following{/other_user}", "gists_url": "https://api.github.com/users/mxjmtxrm/gists{/gist_id}", "starred_url": "https://api.github.com/users/mxjmtxrm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mxjmtxrm/subscriptions", "organizations_url": "https://api.github.com/users/mxjmtxrm/orgs", "repos_url": "https://api.github.com/users/mxjmtxrm/repos", "events_url": "https://api.github.com/users/mxjmtxrm/events{/privacy}", "received_events_url": "https://api.github.com/users/mxjmtxrm/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-07-08T11:44:43
2025-08-17T08:02:45
2025-08-17T08:02:45
NONE
null
null
null
null
### System Info - `transformers` version: 4.54.0.dev0 - Platform: Linux-5.15.0-105-generic-x86_64-with-glibc2.39 - Python version: 3.12.3 - Huggingface_hub version: 0.33.0 - Safetensors version: 0.5.3 - Accelerate version: 1.8.1 - Accelerate config: not found - DeepSpeed version: 0.17.1 - PyTorch version (accelerator?): 2.8.0a0+5228986c39.nv25.05 (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?: <fill in> - Using GPU in script?: <fill in> - GPU type: NVIDIA H100 80GB HBM3 ### Who can help? @SunMarc @zach-huggingface ### 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 train moe model using run_clm.py with deepspeed zero3. ``` CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 accelerate launch --config_file "deepspeed.yaml" run_clm.py \ --do_train \ --do_eval \ --model_name_or_path Qwen3-30B-A3B \ --trust_remote_code True \ --torch_dtype auto \ --train_file train.json \ --validation_file val.json \ --block_size 8192 \ --output_dir ./output \ --weight_decay 0.01 \ --learning_rate 5e-6 \ --lr_scheduler_type "cosine" \ --per_device_train_batch_size 2 \ --per_device_eval_batch_size 2 \ --gradient_accumulation_steps 1 \ --gradient_checkpointing True \ --gradient_checkpointing_kwargs '{"use_reentrant": true}' \ --max_grad_norm 0.5 \ --warmup_ratio 0.03 \ --bf16 \ --num_train_epochs 1 \ --aux_lambda 0 \ --eval_strategy "steps" \ --eval_steps 100 \ --save_strategy "steps" \ --save_steps 100 \ --report_to "tensorboard" \ --save_total_limit 2 \ --logging_steps 10 \ --log_level "info" \ --include_num_input_tokens_seen True \ --overwrite_output_dir \ --save_only_model False ``` deepspeed.yaml: ``` compute_environment: LOCAL_MACHINE debug: false deepspeed_config: deepspeed_multinode_launcher: standard offload_optimizer_device: none offload_param_device: none zero3_init_flag: true zero3_save_16bit_model: true zero_stage: 3 distributed_type: DEEPSPEED downcast_bf16: 'no' machine_rank: 0 main_training_function: main mixed_precision: bf16 num_machines: 1 num_processes: 8 rdzv_backend: static same_network: true tpu_env: [] tpu_use_cluster: false tpu_use_sudo: false use_cpu: false ``` The training process hangs here: ``` 0%| | 1/4966 [00:57<78:36:48, 57.00s/it] ``` And the GPU utilization remains at 100% and does not change. ### Expected behavior Where is the problem? How to solve it?
{ "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/39275/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/39275/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/39274
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39274/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39274/comments
https://api.github.com/repos/huggingface/transformers/issues/39274/events
https://github.com/huggingface/transformers/pull/39274
3,212,115,142
PR_kwDOCUB6oc6d7I71
39,274
Add support for logging number of image tokens
{ "login": "h-tonywu", "id": 211311067, "node_id": "U_kgDODJhZ2w", "avatar_url": "https://avatars.githubusercontent.com/u/211311067?v=4", "gravatar_id": "", "url": "https://api.github.com/users/h-tonywu", "html_url": "https://github.com/h-tonywu", "followers_url": "https://api.github.com/users/h-tonywu/followers", "following_url": "https://api.github.com/users/h-tonywu/following{/other_user}", "gists_url": "https://api.github.com/users/h-tonywu/gists{/gist_id}", "starred_url": "https://api.github.com/users/h-tonywu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/h-tonywu/subscriptions", "organizations_url": "https://api.github.com/users/h-tonywu/orgs", "repos_url": "https://api.github.com/users/h-tonywu/repos", "events_url": "https://api.github.com/users/h-tonywu/events{/privacy}", "received_events_url": "https://api.github.com/users/h-tonywu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-07-08T11:17:09
2025-07-10T09:01:14
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39274", "html_url": "https://github.com/huggingface/transformers/pull/39274", "diff_url": "https://github.com/huggingface/transformers/pull/39274.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39274.patch", "merged_at": null }
# What does this PR do? With a single `include_num_input_image_tokens_seen` flag in the `TrainingArguments` (here with `SFTConfig`), you can report the number of visual tokens seen by the model. Example: ```python from trl import SFTConfig # Configure training arguments using SFTConfig training_args = SFTConfig( # insert other arguments for training report_to="wandb", include_num_input_image_tokens_seen=True, # new ) ``` **Result when training a SmolVL** - Model seed: `HuggingFaceTB/SmolVLM-256M-Instruct` - Dataset: `merve/vqav2-small` ![Screenshot 2025-07-04 at 15 23 04](https://github.com/user-attachments/assets/a36ca688-7e08-4af9-b1a5-58ea63117d0f) **Why is it useful?** When training VLMs, monitoring the number of processed visual tokens helps with knowing the proportion of image-related tokens that are seen by the model during training. Moreover, for VLMs with dynamic patching (e.g., Qwen2-VL) this can also provide a signal about the resolution of images ingested. ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). β†’ TODO - [ ] Did you write any new necessary tests? β†’ there are no existing tests for logging metrics in the repository, so I'm not sure writing my own test is relevant. ## Who can review? @SunMarc, @yonigozlan, @qubvel
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39274/reactions", "total_count": 6, "+1": 3, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 2, "rocket": 1, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/39274/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39273
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39273/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39273/comments
https://api.github.com/repos/huggingface/transformers/issues/39273/events
https://github.com/huggingface/transformers/pull/39273
3,211,897,813
PR_kwDOCUB6oc6d6Yy5
39,273
[CI] fix docs
{ "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-07-08T10:09:35
2025-07-08T10:31:06
2025-07-08T10:31:03
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39273", "html_url": "https://github.com/huggingface/transformers/pull/39273", "diff_url": "https://github.com/huggingface/transformers/pull/39273.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39273.patch", "merged_at": "2025-07-08T10:31:03" }
# What does this PR do? Fixes docs, causing red CI - aimv2 bad return docstring (from #36625) - `glossary` missing from the Korean table of contents (from #38804)
{ "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/39273/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/39273/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39272
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39272/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39272/comments
https://api.github.com/repos/huggingface/transformers/issues/39272/events
https://github.com/huggingface/transformers/pull/39272
3,211,872,919
PR_kwDOCUB6oc6d6TNb
39,272
Update Model Card for Encoder Decoder Model
{ "login": "ParagEkbote", "id": 69567729, "node_id": "MDQ6VXNlcjY5NTY3NzI5", "avatar_url": "https://avatars.githubusercontent.com/u/69567729?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ParagEkbote", "html_url": "https://github.com/ParagEkbote", "followers_url": "https://api.github.com/users/ParagEkbote/followers", "following_url": "https://api.github.com/users/ParagEkbote/following{/other_user}", "gists_url": "https://api.github.com/users/ParagEkbote/gists{/gist_id}", "starred_url": "https://api.github.com/users/ParagEkbote/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ParagEkbote/subscriptions", "organizations_url": "https://api.github.com/users/ParagEkbote/orgs", "repos_url": "https://api.github.com/users/ParagEkbote/repos", "events_url": "https://api.github.com/users/ParagEkbote/events{/privacy}", "received_events_url": "https://api.github.com/users/ParagEkbote/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T10:02:55
2025-07-11T18:24:41
2025-07-11T18:23:08
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39272", "html_url": "https://github.com/huggingface/transformers/pull/39272", "diff_url": "https://github.com/huggingface/transformers/pull/39272.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39272.patch", "merged_at": "2025-07-11T18:23:08" }
# What does this PR do? As described in the issue, this PR updates the model card for the encoder decoder model with an additional translation example. I have also re-added the contributor names for the Mamba and Mamba-2 models which were previously removed by me. Please let me know if any modifications are required and I will make the necessary changes. Fixes #8944 Refs #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
{ "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/39272/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/39272/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39271
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39271/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39271/comments
https://api.github.com/repos/huggingface/transformers/issues/39271/events
https://github.com/huggingface/transformers/pull/39271
3,211,844,081
PR_kwDOCUB6oc6d6M08
39,271
[smollm3] add tokenizer mapping for `smollm3`
{ "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 }
[ { "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-07-08T09:54:07
2025-07-08T12:28:32
2025-07-08T10:44:01
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39271", "html_url": "https://github.com/huggingface/transformers/pull/39271", "diff_url": "https://github.com/huggingface/transformers/pull/39271.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39271.patch", "merged_at": "2025-07-08T10:44:01" }
# What does this PR do? Adds a tokenizer mapping for `smollm3`, which fixes the following script ```py from transformers import pipeline # tokenizer is infered from the model, through the tokenizer mapping pipe = pipeline("text-generation", model="HuggingFaceTB/SmolLM3-3B-Base") pipe("Once upon a time,") ```
{ "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/39271/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/39271/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39270
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39270/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39270/comments
https://api.github.com/repos/huggingface/transformers/issues/39270/events
https://github.com/huggingface/transformers/pull/39270
3,211,727,330
PR_kwDOCUB6oc6d5zTL
39,270
fix recompiles due to instance key, and deepcopy issues
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T09:18:28
2025-07-08T09:57:24
2025-07-08T09:38:11
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39270", "html_url": "https://github.com/huggingface/transformers/pull/39270", "diff_url": "https://github.com/huggingface/transformers/pull/39270.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39270.patch", "merged_at": "2025-07-08T09:38:11" }
# What does this PR do? Deep copy and recompiles should be fixed
{ "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/39270/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/39270/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39269
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39269/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39269/comments
https://api.github.com/repos/huggingface/transformers/issues/39269/events
https://github.com/huggingface/transformers/issues/39269
3,211,495,758
I_kwDOCUB6oc6_a4lO
39,269
SigLip2 text pooler output selection
{ "login": "Jason3900", "id": 55134225, "node_id": "MDQ6VXNlcjU1MTM0MjI1", "avatar_url": "https://avatars.githubusercontent.com/u/55134225?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Jason3900", "html_url": "https://github.com/Jason3900", "followers_url": "https://api.github.com/users/Jason3900/followers", "following_url": "https://api.github.com/users/Jason3900/following{/other_user}", "gists_url": "https://api.github.com/users/Jason3900/gists{/gist_id}", "starred_url": "https://api.github.com/users/Jason3900/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Jason3900/subscriptions", "organizations_url": "https://api.github.com/users/Jason3900/orgs", "repos_url": "https://api.github.com/users/Jason3900/repos", "events_url": "https://api.github.com/users/Jason3900/events{/privacy}", "received_events_url": "https://api.github.com/users/Jason3900/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[ { "id": 3817266200, "node_id": "MDU6TGFiZWwzODE3MjY2MjAw", "url": "https://api.github.com/repos/huggingface/transformers/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": null }, { "id": 5769473378, "node_id": "LA_kwDOCUB6oc8AAAABV-MtYg", "url": "https://api.github.com/repos/huggingface/transformers/labels/Vision", "name": "Vision", "color": "C079EF", "default": false, "description": "" } ]
closed
false
null
[]
null
[]
2025-07-08T08:08:02
2025-07-16T12:57:14
2025-07-16T12:57:13
NONE
null
null
null
null
### System Info transformers==4.51.3 python==3.10.16 torch==2.7.0+cu128 ### Who can help? @amyeroberts @qubvel ### 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 Hey. I'm finetuning a siglip2 model and find some issues. From the original code from [google](https://github.com/google-research/big_vision/blob/0127fb6b337ee2a27bf4e54dea79cff176527356/big_vision/models/proj/image_text/text_transformer.py#L83), the text ids' last position is assumed to be eos token. While if I use transformers preprocessor following the doc, text whose token length is less than max_length will pad to max_length. In that case, the last token is not eos but pad. Since the [code](https://github.com/huggingface/transformers/blob/17b3c96c00cd8421bff85282aec32422bdfebd31/src/transformers/models/siglip2/modeling_siglip2.py#L692) always takes the last position to feed into the pool layer, I think there might be some mismatches? ``` # Assuming "sticky" EOS tokenization, last token is always EOS. pooled_output = last_hidden_state[:, -1, :] pooled_output = self.head(pooled_output) ``` And another question is the preprocessor's output doesn't contain attention_mask, should I manually build it according to padding positions or the original model doesn't use attention_mask for padding at all? ### Expected behavior I want some explanation.
{ "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/39269/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/39269/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/39268
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39268/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39268/comments
https://api.github.com/repos/huggingface/transformers/issues/39268/events
https://github.com/huggingface/transformers/pull/39268
3,211,303,778
PR_kwDOCUB6oc6d4YY5
39,268
🌐 [i18n-KO] Translated quark.md to Korean
{ "login": "maximizemaxwell", "id": 138701551, "node_id": "U_kgDOCERq7w", "avatar_url": "https://avatars.githubusercontent.com/u/138701551?v=4", "gravatar_id": "", "url": "https://api.github.com/users/maximizemaxwell", "html_url": "https://github.com/maximizemaxwell", "followers_url": "https://api.github.com/users/maximizemaxwell/followers", "following_url": "https://api.github.com/users/maximizemaxwell/following{/other_user}", "gists_url": "https://api.github.com/users/maximizemaxwell/gists{/gist_id}", "starred_url": "https://api.github.com/users/maximizemaxwell/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/maximizemaxwell/subscriptions", "organizations_url": "https://api.github.com/users/maximizemaxwell/orgs", "repos_url": "https://api.github.com/users/maximizemaxwell/repos", "events_url": "https://api.github.com/users/maximizemaxwell/events{/privacy}", "received_events_url": "https://api.github.com/users/maximizemaxwell/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T07:02:34
2025-07-09T16:29:51
2025-07-09T16:29:51
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39268", "html_url": "https://github.com/huggingface/transformers/pull/39268", "diff_url": "https://github.com/huggingface/transformers/pull/39268.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39268.patch", "merged_at": "2025-07-09T16:29:51" }
# What does this PR do? Translated the quark.md file of the documentation to Korean. Thank you in advance for your review. Part of https://github.com/huggingface/transformers/issues/20179 ## Before reviewing - [x] Check for missing / redundant translations (λ²ˆμ—­ λˆ„λ½/쀑볡 검사) - [x] Grammar Check (λ§žμΆ€λ²• 검사) - [x] Review or Add new terms to glossary (μš©μ–΄ 확인 및 μΆ”κ°€) - [x] Check Inline TOC (e.g. [[lowercased-header]]) - [ ] Check live-preview for gotchas (live-preview둜 μ •μƒμž‘λ™ 확인) ## Who can review? (Initial) @4N3MONE, @harheem @jungnerd @yijun-lee ## 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#start-contributing-pull-requests), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [x] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? (Final) @stevhliu May you please review this PR?
{ "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/39268/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/39268/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39267
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39267/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39267/comments
https://api.github.com/repos/huggingface/transformers/issues/39267/events
https://github.com/huggingface/transformers/pull/39267
3,211,190,365
PR_kwDOCUB6oc6d4ADC
39,267
Fix/timm version check gemma3n
{ "login": "sameerajashyam", "id": 79054143, "node_id": "MDQ6VXNlcjc5MDU0MTQz", "avatar_url": "https://avatars.githubusercontent.com/u/79054143?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sameerajashyam", "html_url": "https://github.com/sameerajashyam", "followers_url": "https://api.github.com/users/sameerajashyam/followers", "following_url": "https://api.github.com/users/sameerajashyam/following{/other_user}", "gists_url": "https://api.github.com/users/sameerajashyam/gists{/gist_id}", "starred_url": "https://api.github.com/users/sameerajashyam/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sameerajashyam/subscriptions", "organizations_url": "https://api.github.com/users/sameerajashyam/orgs", "repos_url": "https://api.github.com/users/sameerajashyam/repos", "events_url": "https://api.github.com/users/sameerajashyam/events{/privacy}", "received_events_url": "https://api.github.com/users/sameerajashyam/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T06:18:43
2025-07-11T11:41:29
2025-07-08T17:38:29
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39267", "html_url": "https://github.com/huggingface/transformers/pull/39267", "diff_url": "https://github.com/huggingface/transformers/pull/39267.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39267.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 - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [ ] Did you write any new necessary tests? ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. <!-- 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 --> Adds a version check in `Gemma3nForConditionalGeneration` to ensure `timm >= 0.9.16`. This prevents users from accidentally using outdated `timm` versions that don’t support models like `mobilenetv5_300m_enc`, and raises a clear `ImportError` if the requirement isn’t met. Fixes #39208
{ "login": "sameerajashyam", "id": 79054143, "node_id": "MDQ6VXNlcjc5MDU0MTQz", "avatar_url": "https://avatars.githubusercontent.com/u/79054143?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sameerajashyam", "html_url": "https://github.com/sameerajashyam", "followers_url": "https://api.github.com/users/sameerajashyam/followers", "following_url": "https://api.github.com/users/sameerajashyam/following{/other_user}", "gists_url": "https://api.github.com/users/sameerajashyam/gists{/gist_id}", "starred_url": "https://api.github.com/users/sameerajashyam/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sameerajashyam/subscriptions", "organizations_url": "https://api.github.com/users/sameerajashyam/orgs", "repos_url": "https://api.github.com/users/sameerajashyam/repos", "events_url": "https://api.github.com/users/sameerajashyam/events{/privacy}", "received_events_url": "https://api.github.com/users/sameerajashyam/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39267/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/39267/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39266
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39266/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39266/comments
https://api.github.com/repos/huggingface/transformers/issues/39266/events
https://github.com/huggingface/transformers/issues/39266
3,211,068,048
I_kwDOCUB6oc6_ZQKQ
39,266
Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length.
{ "login": "mumu029", "id": 51202355, "node_id": "MDQ6VXNlcjUxMjAyMzU1", "avatar_url": "https://avatars.githubusercontent.com/u/51202355?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mumu029", "html_url": "https://github.com/mumu029", "followers_url": "https://api.github.com/users/mumu029/followers", "following_url": "https://api.github.com/users/mumu029/following{/other_user}", "gists_url": "https://api.github.com/users/mumu029/gists{/gist_id}", "starred_url": "https://api.github.com/users/mumu029/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mumu029/subscriptions", "organizations_url": "https://api.github.com/users/mumu029/orgs", "repos_url": "https://api.github.com/users/mumu029/repos", "events_url": "https://api.github.com/users/mumu029/events{/privacy}", "received_events_url": "https://api.github.com/users/mumu029/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-07-08T05:19:35
2025-07-08T06:50:47
2025-07-08T06:50:47
NONE
null
null
null
null
### System Info ```bash Traceback (most recent call last): File "/home/cx/miniconda3/envs/demo/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 767, in convert_to_tensors tensor = as_tensor(value) File "/home/cx/miniconda3/envs/demo/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 729, in as_tensor return torch.tensor(value) ValueError: expected sequence of length 15757 at dim 1 (got 16242) ``` *DataCollatorForLanguageModeling* seems to only padding input ids and ignore labels, resulting in different lengths of labels in a batch. Why is this? ### 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 ```python def _process_fn(samples, tokenizer : PreTrainedTokenizerFast, config): samples = [[{"role" : "user", "content" : x[0]}, {"role" : "assistant", "content" : x[1]}] for x in zip(samples["input"], samples["output"])] # tokenized_data = tokenizer.apply_chat_template(samples, # return_tensors="pt", # return_dict=True, # padding="max_length", # truncation=True, # max_length=8000) tokenized_data = tokenizer.apply_chat_template(samples, return_tensors="pt", return_dict=True, padding=True ) samples_ids = tokenized_data["input_ids"] attention_mask = tokenized_data["attention_mask"] output_ids = [] for i, seq in enumerate(samples_ids): output_index = torch.where(seq == SPECIAL_GENERATE_TOKEN_ID)[0] mask = attention_mask[i] if len(output_index) == 1: output_index = output_index[0].item() else: continue temp = torch.full_like(seq, -100) temp[output_index:] = seq[output_index:] temp[mask == 0] = -100 output_ids.append(temp) labels = torch.stack(output_ids) return {"input_ids" : samples_ids, "labels" : labels, "attention_mask" : attention_mask} trainer = Trainer( model=peft_model, args=train_config, train_dataset=train_data, eval_dataset=eval_data, data_collator=DataCollatorForLanguageModeling( tokenizer=tokenizer, mlm=False, pad_to_multiple_of=8 if torch.cuda.is_available() else None, return_tensors="pt" ) ) ``` ### Expected behavior run code
{ "login": "mumu029", "id": 51202355, "node_id": "MDQ6VXNlcjUxMjAyMzU1", "avatar_url": "https://avatars.githubusercontent.com/u/51202355?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mumu029", "html_url": "https://github.com/mumu029", "followers_url": "https://api.github.com/users/mumu029/followers", "following_url": "https://api.github.com/users/mumu029/following{/other_user}", "gists_url": "https://api.github.com/users/mumu029/gists{/gist_id}", "starred_url": "https://api.github.com/users/mumu029/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mumu029/subscriptions", "organizations_url": "https://api.github.com/users/mumu029/orgs", "repos_url": "https://api.github.com/users/mumu029/repos", "events_url": "https://api.github.com/users/mumu029/events{/privacy}", "received_events_url": "https://api.github.com/users/mumu029/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39266/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/39266/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/39265
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39265/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39265/comments
https://api.github.com/repos/huggingface/transformers/issues/39265/events
https://github.com/huggingface/transformers/pull/39265
3,210,866,744
PR_kwDOCUB6oc6d26YX
39,265
Refactor label name handling for PEFT models in Trainer class
{ "login": "qgallouedec", "id": 45557362, "node_id": "MDQ6VXNlcjQ1NTU3MzYy", "avatar_url": "https://avatars.githubusercontent.com/u/45557362?v=4", "gravatar_id": "", "url": "https://api.github.com/users/qgallouedec", "html_url": "https://github.com/qgallouedec", "followers_url": "https://api.github.com/users/qgallouedec/followers", "following_url": "https://api.github.com/users/qgallouedec/following{/other_user}", "gists_url": "https://api.github.com/users/qgallouedec/gists{/gist_id}", "starred_url": "https://api.github.com/users/qgallouedec/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/qgallouedec/subscriptions", "organizations_url": "https://api.github.com/users/qgallouedec/orgs", "repos_url": "https://api.github.com/users/qgallouedec/repos", "events_url": "https://api.github.com/users/qgallouedec/events{/privacy}", "received_events_url": "https://api.github.com/users/qgallouedec/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-08T03:13:28
2025-08-04T06:29:58
2025-08-04T06:29:57
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39265", "html_url": "https://github.com/huggingface/transformers/pull/39265", "diff_url": "https://github.com/huggingface/transformers/pull/39265.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39265.patch", "merged_at": "2025-08-04T06:29:57" }
# What does this PR do? Fix https://github.com/huggingface/trl/issues/3694 ## 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? @SunMarc
{ "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/39265/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/39265/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39264
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39264/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39264/comments
https://api.github.com/repos/huggingface/transformers/issues/39264/events
https://github.com/huggingface/transformers/pull/39264
3,210,482,985
PR_kwDOCUB6oc6d1osQ
39,264
Fix: Add version check for timm to support mobilenetv5 models (fixes #39208)
{ "login": "VIGNESH15103", "id": 121597724, "node_id": "U_kgDOBz9vHA", "avatar_url": "https://avatars.githubusercontent.com/u/121597724?v=4", "gravatar_id": "", "url": "https://api.github.com/users/VIGNESH15103", "html_url": "https://github.com/VIGNESH15103", "followers_url": "https://api.github.com/users/VIGNESH15103/followers", "following_url": "https://api.github.com/users/VIGNESH15103/following{/other_user}", "gists_url": "https://api.github.com/users/VIGNESH15103/gists{/gist_id}", "starred_url": "https://api.github.com/users/VIGNESH15103/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/VIGNESH15103/subscriptions", "organizations_url": "https://api.github.com/users/VIGNESH15103/orgs", "repos_url": "https://api.github.com/users/VIGNESH15103/repos", "events_url": "https://api.github.com/users/VIGNESH15103/events{/privacy}", "received_events_url": "https://api.github.com/users/VIGNESH15103/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-07-07T23:11:02
2025-07-14T11:15:17
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39264", "html_url": "https://github.com/huggingface/transformers/pull/39264", "diff_url": "https://github.com/huggingface/transformers/pull/39264.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39264.patch", "merged_at": null }
### What does this PR do? Fixes issue #39208: Adds a version check for `timm` to ensure support for models like `mobilenetv5_300m_enc`, which require `timm >= 0.9.10`. ### Motivation The issue occurred because the `mobilenetv5_300m_enc` model name was not recognized in older versions of `timm`. This PR adds a conditional check to raise an informative `ImportError` if an unsupported version is detected. ### Changes - Added a version check using `packaging.version` inside `TimmWrapperImageProcessor.__init__`. - Raises an error if a `mobilenetv5` model is used with `timm < 0.9.10`. ### Issue Link Closes #39208 ### Reviewer Suggestion @amyeroberts @qubvel (vision models)
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39264/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/39264/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39263
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39263/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39263/comments
https://api.github.com/repos/huggingface/transformers/issues/39263/events
https://github.com/huggingface/transformers/pull/39263
3,210,409,046
PR_kwDOCUB6oc6d1YYB
39,263
[Core] [Offloading] Enable saving offloaded models with multiple shared tensor groups
{ "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-07-07T22:32:29
2025-07-16T12:26:49
2025-07-10T16:33:30
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39263", "html_url": "https://github.com/huggingface/transformers/pull/39263", "diff_url": "https://github.com/huggingface/transformers/pull/39263.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39263.patch", "merged_at": "2025-07-10T16:33:30" }
## Purpose ## * Fixes https://github.com/huggingface/transformers/issues/39097 * Enables models with multiple groups of shared tensors to be saved * For example, the token_embeds and lm_head weights are one group of shared tensors * Right now, only one group can be shared at a time, as indicated by `tied_names = tied_params[0]` * This enablement is useful for registering additional modules with shared tensors, such as quip/spinquant-like transforms ## Changes ## * Instead of building a separate pathway for calculating shared tensors when offloaded, instead update `ptrs` calculation logic to be capable of handling meta tensors * This is equivalent to the `find_tied_parameters` method, since in the meta device case, both check for equality of the python object itself * Misc, update tied tensors runtime error to suggest using `_dynamic_tied_weights_keys`, which is also a valid way of saving tied tensors ## Testing ## ```python3 import torch from transformers import AutoModelForCausalLM device_map = { "model.embed_tokens": "cuda:0", "model.layers": "cpu", "model.norm": "cpu", "model.rotary_emb": "cpu", "lm_head": "cuda:0" } model = AutoModelForCausalLM.from_pretrained("nm-testing/llama2.c-stories15M", device_map=device_map) transform_a = torch.nn.Linear(1, 1, bias=False) transform_a._dynamic_tied_weights_keys = ["weight"] transform_b = torch.nn.Linear(1, 1, bias=False) transform_b._dynamic_tied_weights_keys = ["weight"] model.model.layers[0].self_attn.q_proj.register_module("transform", transform_a) model.model.layers[1].self_attn.q_proj.register_module("transform", transform_a) model.model.layers[2].self_attn.q_proj.register_module("transform", transform_b) model.model.layers[3].self_attn.q_proj.register_module("transform", transform_b) model.save_pretrained("tmp") ``` * Added test fails on main but succeeds with these changes
{ "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/39263/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/39263/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39262
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39262/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39262/comments
https://api.github.com/repos/huggingface/transformers/issues/39262/events
https://github.com/huggingface/transformers/pull/39262
3,210,236,695
PR_kwDOCUB6oc6d0zcy
39,262
Improve ELECTRA documentation with explanations and helpful links
{ "login": "PrakyathMC", "id": 92665624, "node_id": "U_kgDOBYX3GA", "avatar_url": "https://avatars.githubusercontent.com/u/92665624?v=4", "gravatar_id": "", "url": "https://api.github.com/users/PrakyathMC", "html_url": "https://github.com/PrakyathMC", "followers_url": "https://api.github.com/users/PrakyathMC/followers", "following_url": "https://api.github.com/users/PrakyathMC/following{/other_user}", "gists_url": "https://api.github.com/users/PrakyathMC/gists{/gist_id}", "starred_url": "https://api.github.com/users/PrakyathMC/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/PrakyathMC/subscriptions", "organizations_url": "https://api.github.com/users/PrakyathMC/orgs", "repos_url": "https://api.github.com/users/PrakyathMC/repos", "events_url": "https://api.github.com/users/PrakyathMC/events{/privacy}", "received_events_url": "https://api.github.com/users/PrakyathMC/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T20:57:58
2025-07-08T15:22:52
2025-07-08T15:22:52
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39262", "html_url": "https://github.com/huggingface/transformers/pull/39262", "diff_url": "https://github.com/huggingface/transformers/pull/39262.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39262.patch", "merged_at": null }
## What does this PR do? Improves the ELECTRA model documentation following the standardized format outlined in #36979. ## Changes Made - βœ… Added explanatory comments to Pipeline and AutoModel code examples - βœ… Added "Quick Links" section with popular ELECTRA models on HuggingFace Hub - βœ… Included additional resources (paper links, model collection) - βœ… Improved accessibility for beginners learning to use ELECTRA ## Before and After **Before**: Basic code examples without explanations **After**: Commented code that teaches users what each line does + easy access to models Fixes #36979
{ "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/39262/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/39262/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39261
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39261/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39261/comments
https://api.github.com/repos/huggingface/transformers/issues/39261/events
https://github.com/huggingface/transformers/pull/39261
3,210,147,900
PR_kwDOCUB6oc6d0f0w
39,261
fix: providing a tensor to `cache_position` in `model.generate` kwargs always crashes because of boolean test
{ "login": "guicho271828", "id": 1321968, "node_id": "MDQ6VXNlcjEzMjE5Njg=", "avatar_url": "https://avatars.githubusercontent.com/u/1321968?v=4", "gravatar_id": "", "url": "https://api.github.com/users/guicho271828", "html_url": "https://github.com/guicho271828", "followers_url": "https://api.github.com/users/guicho271828/followers", "following_url": "https://api.github.com/users/guicho271828/following{/other_user}", "gists_url": "https://api.github.com/users/guicho271828/gists{/gist_id}", "starred_url": "https://api.github.com/users/guicho271828/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/guicho271828/subscriptions", "organizations_url": "https://api.github.com/users/guicho271828/orgs", "repos_url": "https://api.github.com/users/guicho271828/repos", "events_url": "https://api.github.com/users/guicho271828/events{/privacy}", "received_events_url": "https://api.github.com/users/guicho271828/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T20:19:39
2025-07-09T09:45:41
2025-07-09T09:41:28
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39261", "html_url": "https://github.com/huggingface/transformers/pull/39261", "diff_url": "https://github.com/huggingface/transformers/pull/39261.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39261.patch", "merged_at": null }
Currently, giving `cache_position` to `model.generate` is broken because providing any tensor value to it results in performing a boolean test, which causes a runtime error. This PR fixes it. This is basically an oversight in the change commited in #37986 --- the code path is untested. <!-- 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. --> ``` Traceback (most recent call last): File "/home/masataro/test-kv.py", line 77, in <module> outputs = model.generate(**inputs_trimmed, do_sample=False, max_new_tokens=256, past_key_values=past_key_values, cache_position=cache_position) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/masataro/miniforge3/envs/test/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/masataro/miniforge3/envs/test/lib/python3.12/site-packages/transformers/generation/utils.py", line 2623, in generate result = self._sample( ^^^^^^^^^^^^^ File "/home/masataro/miniforge3/envs/test/lib/python3.12/site-packages/transformers/generation/utils.py", line 3568, in _sample model_kwargs = self._get_initial_cache_position(cur_len, input_ids.device, model_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/masataro/miniforge3/envs/test/lib/python3.12/site-packages/transformers/generation/utils.py", line 1799, in _get_initial_cache_position if "cache_position" in model_kwargs and model_kwargs["cache_position"]: ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^ RuntimeError: Boolean value of Tensor with more than one value is ambiguous ``` sample code (test-kv.py): ```python import torch from transformers import AutoTokenizer,AutoModelForCausalLM from transformers.cache_utils import ( DynamicCache, ) model_id = "ibm-granite/granite-3.2-8b-instruct" model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map='auto') tokenizer = AutoTokenizer.from_pretrained(model_id) user_prompts = ["Hello, what's your name?", "Btw, yesterday I was on a rock concert.", "The song was 'we are the world'", ] # with kv cache for all past context past_key_values = DynamicCache() last_output_length=0 messages = [] for prompt in user_prompts: # outputs[0].shape[1] # /~~~~~~~~~~~~~~~~~~~~~~~~~~\ output contains this string # IIIIIIIIOOOOOOOOOOIIIIIIIIIOOOOOOOOOOOOOOOOOO # | +-- input length | # +--last output length + next output length # \-----------------/ # completion print(prompt) messages.append({"role": "user", "content": prompt}) inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device) input_length = inputs["input_ids"].shape[1] inputs_trimmed={ 'input_ids':inputs["input_ids"][:, last_output_length:], 'attention_mask':inputs["attention_mask"], } cache_position = torch.arange(last_output_length, input_length, dtype=torch.int64, device=model.device) assert inputs_trimmed["input_ids"].shape[1] == cache_position.shape[0] outputs = model.generate(**inputs_trimmed, do_sample=False, max_new_tokens=256, use_cache=True, past_key_values=past_key_values, cache_position=cache_position) completion = tokenizer.decode(outputs[0, input_length - last_output_length: ], skip_special_tokens=True) print(completion) messages.append({"role": "assistant", "content": completion}) last_output_length += outputs.shape[1] ``` ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). --- *does not apply* - [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. --- *could not find any similar issue* - [ ] 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). --- *does not apply* - [ ] Did you write any new necessary tests? --- *help needed.* ## Who can review? @FremyCompany @ArthurZucker @zucchini-nlp @gante
{ "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/39261/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/39261/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39260
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39260/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39260/comments
https://api.github.com/repos/huggingface/transformers/issues/39260/events
https://github.com/huggingface/transformers/issues/39260
3,209,799,793
I_kwDOCUB6oc6_Uahx
39,260
Please help i am trying to run model but issue
{ "login": "vinaydanidhariya", "id": 66329591, "node_id": "MDQ6VXNlcjY2MzI5NTkx", "avatar_url": "https://avatars.githubusercontent.com/u/66329591?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vinaydanidhariya", "html_url": "https://github.com/vinaydanidhariya", "followers_url": "https://api.github.com/users/vinaydanidhariya/followers", "following_url": "https://api.github.com/users/vinaydanidhariya/following{/other_user}", "gists_url": "https://api.github.com/users/vinaydanidhariya/gists{/gist_id}", "starred_url": "https://api.github.com/users/vinaydanidhariya/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vinaydanidhariya/subscriptions", "organizations_url": "https://api.github.com/users/vinaydanidhariya/orgs", "repos_url": "https://api.github.com/users/vinaydanidhariya/repos", "events_url": "https://api.github.com/users/vinaydanidhariya/events{/privacy}", "received_events_url": "https://api.github.com/users/vinaydanidhariya/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T17:40:47
2025-08-21T17:43:37
2025-08-17T08:02:47
NONE
null
null
null
null
``` # install libraries # Uninstall broken stable PyTorch !pip uninstall -y torch torchvision torchaudio # Install latest nightly PyTorch compatible with Python 3.12 (for CPU) !pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu !pip install transformers==4.41.2 peft==0.11.1 librosa==0.10.2 !pip install triton !pip install --upgrade accelerate import transformers import librosa # load the model pipeline on gpu:0 # pipe = transformers.pipeline(model='sarvamai/shuka_v1', trust_remote_code=True, device=0, torch_dtype='bfloat16') from transformers import pipeline pipe = pipeline( model='sarvamai/shuka_v1', trust_remote_code=True, device=-1 # force CPU to prevent Triton / GPU-related crashes ) # get a sample audio # wget https://huggingface.co/sarvamai/shuka_v1/resolve/main/hi-question.webm audio, sr = librosa.load("./hi-question.webm", sr=16000) turns = [ {'role': 'system', 'content': 'Respond naturally and informatively.'}, {'role': 'user', 'content': '<|audio|>'} ] pipe({'audio': audio, 'turns': turns, 'sampling_rate': sr}, max_new_tokens=512) ``` Found existing installation: torch 2.9.0.dev20250707+cpu Uninstalling torch-2.9.0.dev20250707+cpu: Successfully uninstalled torch-2.9.0.dev20250707+cpu Found existing installation: torchvision 0.24.0.dev20250707+cpu Uninstalling torchvision-0.24.0.dev20250707+cpu: Successfully uninstalled torchvision-0.24.0.dev20250707+cpu Found existing installation: torchaudio 2.8.0.dev20250707+cpu Uninstalling torchaudio-2.8.0.dev20250707+cpu: Successfully uninstalled torchaudio-2.8.0.dev20250707+cpu Looking in indexes: https://download.pytorch.org/whl/nightly/cpu Collecting torch Using cached https://download.pytorch.org/whl/nightly/cpu/torch-2.9.0.dev20250707%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (28 kB) Collecting torchvision Using cached https://download.pytorch.org/whl/nightly/cpu/torchvision-0.24.0.dev20250707%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (6.2 kB) Collecting torchaudio Using cached https://download.pytorch.org/whl/nightly/cpu/torchaudio-2.8.0.dev20250707%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (7.3 kB) Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from torch) (3.18.0) Requirement already satisfied: typing-extensions>=4.10.0 in /usr/local/lib/python3.11/dist-packages (from torch) (4.13.2) Requirement already satisfied: sympy>=1.13.3 in /usr/local/lib/python3.11/dist-packages (from torch) (1.14.0) Requirement already satisfied: networkx in /usr/local/lib/python3.11/dist-packages (from torch) (3.4.2) Requirement already satisfied: jinja2 in /usr/local/lib/python3.11/dist-packages (from torch) (3.1.6) Requirement already satisfied: fsspec in /usr/local/lib/python3.11/dist-packages (from torch) (2025.3.2) Requirement already satisfied: numpy in /usr/local/lib/python3.11/dist-packages (from torchvision) (1.26.4) Requirement already satisfied: pillow!=8.3.*,<11.3,>=5.3.0 in /usr/local/lib/python3.11/dist-packages (from torchvision) (11.1.0) Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from sympy>=1.13.3->torch) (1.3.0) Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/dist-packages (from jinja2->torch) (3.0.2) Requirement already satisfied: mkl_fft in /usr/local/lib/python3.11/dist-packages (from numpy->torchvision) (1.3.8) Requirement already satisfied: mkl_random in /usr/local/lib/python3.11/dist-packages (from numpy->torchvision) (1.2.4) Requirement already satisfied: mkl_umath in /usr/local/lib/python3.11/dist-packages (from numpy->torchvision) (0.1.1) Requirement already satisfied: mkl in /usr/local/lib/python3.11/dist-packages (from numpy->torchvision) (2025.1.0) Requirement already satisfied: tbb4py in /usr/local/lib/python3.11/dist-packages (from numpy->torchvision) (2022.1.0) Requirement already satisfied: mkl-service in /usr/local/lib/python3.11/dist-packages (from numpy->torchvision) (2.4.1) Requirement already satisfied: intel-openmp<2026,>=2024 in /usr/local/lib/python3.11/dist-packages (from mkl->numpy->torchvision) (2024.2.0) Requirement already satisfied: tbb==2022.* in /usr/local/lib/python3.11/dist-packages (from mkl->numpy->torchvision) (2022.1.0) Requirement already satisfied: tcmlib==1.* in /usr/local/lib/python3.11/dist-packages (from tbb==2022.*->mkl->numpy->torchvision) (1.3.0) Requirement already satisfied: intel-cmplr-lib-rt in /usr/local/lib/python3.11/dist-packages (from mkl_umath->numpy->torchvision) (2024.2.0) Requirement already satisfied: intel-cmplr-lib-ur==2024.2.0 in /usr/local/lib/python3.11/dist-packages (from intel-openmp<2026,>=2024->mkl->numpy->torchvision) (2024.2.0) Using cached https://download.pytorch.org/whl/nightly/cpu/torch-2.9.0.dev20250707%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl (184.4 MB) Using cached https://download.pytorch.org/whl/nightly/cpu/torchvision-0.24.0.dev20250707%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl (2.0 MB) Using cached https://download.pytorch.org/whl/nightly/cpu/torchaudio-2.8.0.dev20250707%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl (1.8 MB) Installing collected packages: torch, torchaudio, torchvision ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. fastai 2.7.19 requires torch<2.7,>=1.10, but you have torch 2.9.0.dev20250707+cpu which is incompatible. Successfully installed torch-2.9.0.dev20250707+cpu torchaudio-2.8.0.dev20250707+cpu torchvision-0.24.0.dev20250707+cpu Requirement already satisfied: transformers==4.41.2 in /usr/local/lib/python3.11/dist-packages (4.41.2) Requirement already satisfied: peft==0.11.1 in /usr/local/lib/python3.11/dist-packages (0.11.1) Requirement already satisfied: librosa==0.10.2 in /usr/local/lib/python3.11/dist-packages (0.10.2) Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from transformers==4.41.2) (3.18.0) Requirement already satisfied: huggingface-hub<1.0,>=0.23.0 in /usr/local/lib/python3.11/dist-packages (from transformers==4.41.2) (0.31.1) Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.11/dist-packages (from transformers==4.41.2) (1.26.4) Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.11/dist-packages (from transformers==4.41.2) (25.0) Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/dist-packages (from transformers==4.41.2) (6.0.2) Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.11/dist-packages (from transformers==4.41.2) (2024.11.6) Requirement already satisfied: requests in /usr/local/lib/python3.11/dist-packages (from transformers==4.41.2) (2.32.3) Requirement already satisfied: tokenizers<0.20,>=0.19 in /usr/local/lib/python3.11/dist-packages (from transformers==4.41.2) (0.19.1) Requirement already satisfied: safetensors>=0.4.1 in /usr/local/lib/python3.11/dist-packages (from transformers==4.41.2) (0.5.3) Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.11/dist-packages (from transformers==4.41.2) (4.67.1) Requirement already satisfied: psutil in /usr/local/lib/python3.11/dist-packages (from peft==0.11.1) (7.0.0) Requirement already satisfied: torch>=1.13.0 in /usr/local/lib/python3.11/dist-packages (from peft==0.11.1) (2.9.0.dev20250707+cpu) Requirement already satisfied: accelerate>=0.21.0 in /usr/local/lib/python3.11/dist-packages (from peft==0.11.1) (1.5.2) Requirement already satisfied: audioread>=2.1.9 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (3.0.1) Requirement already satisfied: scipy>=1.2.0 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (1.15.2) Requirement already satisfied: scikit-learn>=0.20.0 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (1.2.2) Requirement already satisfied: joblib>=0.14 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (1.5.0) Requirement already satisfied: decorator>=4.3.0 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (4.4.2) Requirement already satisfied: numba>=0.51.0 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (0.60.0) Requirement already satisfied: soundfile>=0.12.1 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (0.13.1) Requirement already satisfied: pooch>=1.1 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (1.8.2) Requirement already satisfied: soxr>=0.3.2 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (0.5.0.post1) Requirement already satisfied: typing-extensions>=4.1.1 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (4.13.2) Requirement already satisfied: lazy-loader>=0.1 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (0.4) Requirement already satisfied: msgpack>=1.0 in /usr/local/lib/python3.11/dist-packages (from librosa==0.10.2) (1.1.0) Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub<1.0,>=0.23.0->transformers==4.41.2) (2025.3.2) Requirement already satisfied: hf-xet<2.0.0,>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub<1.0,>=0.23.0->transformers==4.41.2) (1.1.0) Requirement already satisfied: llvmlite<0.44,>=0.43.0dev0 in /usr/local/lib/python3.11/dist-packages (from numba>=0.51.0->librosa==0.10.2) (0.43.0) Requirement already satisfied: mkl_fft in /usr/local/lib/python3.11/dist-packages (from numpy>=1.17->transformers==4.41.2) (1.3.8) Requirement already satisfied: mkl_random in /usr/local/lib/python3.11/dist-packages (from numpy>=1.17->transformers==4.41.2) (1.2.4) Requirement already satisfied: mkl_umath in /usr/local/lib/python3.11/dist-packages (from numpy>=1.17->transformers==4.41.2) (0.1.1) Requirement already satisfied: mkl in /usr/local/lib/python3.11/dist-packages (from numpy>=1.17->transformers==4.41.2) (2025.1.0) Requirement already satisfied: tbb4py in /usr/local/lib/python3.11/dist-packages (from numpy>=1.17->transformers==4.41.2) (2022.1.0) Requirement already satisfied: mkl-service in /usr/local/lib/python3.11/dist-packages (from numpy>=1.17->transformers==4.41.2) (2.4.1) Requirement already satisfied: platformdirs>=2.5.0 in /usr/local/lib/python3.11/dist-packages (from pooch>=1.1->librosa==0.10.2) (4.3.8) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests->transformers==4.41.2) (3.4.2) Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests->transformers==4.41.2) (3.10) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests->transformers==4.41.2) (2.4.0) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests->transformers==4.41.2) (2025.4.26) Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.11/dist-packages (from scikit-learn>=0.20.0->librosa==0.10.2) (3.6.0) Requirement already satisfied: cffi>=1.0 in /usr/local/lib/python3.11/dist-packages (from soundfile>=0.12.1->librosa==0.10.2) (1.17.1) Requirement already satisfied: sympy>=1.13.3 in /usr/local/lib/python3.11/dist-packages (from torch>=1.13.0->peft==0.11.1) (1.14.0) Requirement already satisfied: networkx in /usr/local/lib/python3.11/dist-packages (from torch>=1.13.0->peft==0.11.1) (3.4.2) Requirement already satisfied: jinja2 in /usr/local/lib/python3.11/dist-packages (from torch>=1.13.0->peft==0.11.1) (3.1.6) Requirement already satisfied: pycparser in /usr/local/lib/python3.11/dist-packages (from cffi>=1.0->soundfile>=0.12.1->librosa==0.10.2) (2.22) Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from sympy>=1.13.3->torch>=1.13.0->peft==0.11.1) (1.3.0) Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/dist-packages (from jinja2->torch>=1.13.0->peft==0.11.1) (3.0.2) Requirement already satisfied: intel-openmp<2026,>=2024 in /usr/local/lib/python3.11/dist-packages (from mkl->numpy>=1.17->transformers==4.41.2) (2024.2.0) Requirement already satisfied: tbb==2022.* in /usr/local/lib/python3.11/dist-packages (from mkl->numpy>=1.17->transformers==4.41.2) (2022.1.0) Requirement already satisfied: tcmlib==1.* in /usr/local/lib/python3.11/dist-packages (from tbb==2022.*->mkl->numpy>=1.17->transformers==4.41.2) (1.3.0) Requirement already satisfied: intel-cmplr-lib-rt in /usr/local/lib/python3.11/dist-packages (from mkl_umath->numpy>=1.17->transformers==4.41.2) (2024.2.0) Requirement already satisfied: intel-cmplr-lib-ur==2024.2.0 in /usr/local/lib/python3.11/dist-packages (from intel-openmp<2026,>=2024->mkl->numpy>=1.17->transformers==4.41.2) (2024.2.0) Requirement already satisfied: triton in /usr/local/lib/python3.11/dist-packages (2.2.0) Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from triton) (3.18.0) Requirement already satisfied: accelerate in /usr/local/lib/python3.11/dist-packages (1.5.2) Collecting accelerate Downloading accelerate-1.8.1-py3-none-any.whl.metadata (19 kB) Requirement already satisfied: numpy<3.0.0,>=1.17 in /usr/local/lib/python3.11/dist-packages (from accelerate) (1.26.4) Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.11/dist-packages (from accelerate) (25.0) Requirement already satisfied: psutil in /usr/local/lib/python3.11/dist-packages (from accelerate) (7.0.0) Requirement already satisfied: pyyaml in /usr/local/lib/python3.11/dist-packages (from accelerate) (6.0.2) Requirement already satisfied: torch>=2.0.0 in /usr/local/lib/python3.11/dist-packages (from accelerate) (2.9.0.dev20250707+cpu) Requirement already satisfied: huggingface_hub>=0.21.0 in /usr/local/lib/python3.11/dist-packages (from accelerate) (0.31.1) Requirement already satisfied: safetensors>=0.4.3 in /usr/local/lib/python3.11/dist-packages (from accelerate) (0.5.3) Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from huggingface_hub>=0.21.0->accelerate) (3.18.0) Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub>=0.21.0->accelerate) (2025.3.2) Requirement already satisfied: requests in /usr/local/lib/python3.11/dist-packages (from huggingface_hub>=0.21.0->accelerate) (2.32.3) Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub>=0.21.0->accelerate) (4.67.1) Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub>=0.21.0->accelerate) (4.13.2) Requirement already satisfied: hf-xet<2.0.0,>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub>=0.21.0->accelerate) (1.1.0) Requirement already satisfied: mkl_fft in /usr/local/lib/python3.11/dist-packages (from numpy<3.0.0,>=1.17->accelerate) (1.3.8) Requirement already satisfied: mkl_random in /usr/local/lib/python3.11/dist-packages (from numpy<3.0.0,>=1.17->accelerate) (1.2.4) Requirement already satisfied: mkl_umath in /usr/local/lib/python3.11/dist-packages (from numpy<3.0.0,>=1.17->accelerate) (0.1.1) Requirement already satisfied: mkl in /usr/local/lib/python3.11/dist-packages (from numpy<3.0.0,>=1.17->accelerate) (2025.1.0) Requirement already satisfied: tbb4py in /usr/local/lib/python3.11/dist-packages (from numpy<3.0.0,>=1.17->accelerate) (2022.1.0) Requirement already satisfied: mkl-service in /usr/local/lib/python3.11/dist-packages (from numpy<3.0.0,>=1.17->accelerate) (2.4.1) Requirement already satisfied: sympy>=1.13.3 in /usr/local/lib/python3.11/dist-packages (from torch>=2.0.0->accelerate) (1.14.0) Requirement already satisfied: networkx in /usr/local/lib/python3.11/dist-packages (from torch>=2.0.0->accelerate) (3.4.2) Requirement already satisfied: jinja2 in /usr/local/lib/python3.11/dist-packages (from torch>=2.0.0->accelerate) (3.1.6) Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from sympy>=1.13.3->torch>=2.0.0->accelerate) (1.3.0) Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/dist-packages (from jinja2->torch>=2.0.0->accelerate) (3.0.2) Requirement already satisfied: intel-openmp<2026,>=2024 in /usr/local/lib/python3.11/dist-packages (from mkl->numpy<3.0.0,>=1.17->accelerate) (2024.2.0) Requirement already satisfied: tbb==2022.* in /usr/local/lib/python3.11/dist-packages (from mkl->numpy<3.0.0,>=1.17->accelerate) (2022.1.0) Requirement already satisfied: tcmlib==1.* in /usr/local/lib/python3.11/dist-packages (from tbb==2022.*->mkl->numpy<3.0.0,>=1.17->accelerate) (1.3.0) Requirement already satisfied: intel-cmplr-lib-rt in /usr/local/lib/python3.11/dist-packages (from mkl_umath->numpy<3.0.0,>=1.17->accelerate) (2024.2.0) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub>=0.21.0->accelerate) (3.4.2) Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub>=0.21.0->accelerate) (3.10) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub>=0.21.0->accelerate) (2.4.0) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub>=0.21.0->accelerate) (2025.4.26) Requirement already satisfied: intel-cmplr-lib-ur==2024.2.0 in /usr/local/lib/python3.11/dist-packages (from intel-openmp<2026,>=2024->mkl->numpy<3.0.0,>=1.17->accelerate) (2024.2.0) Downloading accelerate-1.8.1-py3-none-any.whl (365 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 365.3/365.3 kB 6.4 MB/s eta 0:00:00a 0:00:01 Installing collected packages: accelerate Attempting uninstall: accelerate Found existing installation: accelerate 1.5.2 Uninstalling accelerate-1.5.2: Successfully uninstalled accelerate-1.5.2 Successfully installed accelerate-1.8.1 --------------------------------------------------------------------------- ImportError Traceback (most recent call last) /usr/local/lib/python3.11/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name) 1534 try: -> 1535 return importlib.import_module("." + module_name, self.__name__) 1536 except Exception as e: /usr/lib/python3.11/importlib/__init__.py in import_module(name, package) 125 level += 1 --> 126 return _bootstrap._gcd_import(name[level:], package, level) 127 /usr/lib/python3.11/importlib/_bootstrap.py in _gcd_import(name, package, level) /usr/lib/python3.11/importlib/_bootstrap.py in _find_and_load(name, import_) /usr/lib/python3.11/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_) /usr/lib/python3.11/importlib/_bootstrap.py in _load_unlocked(spec) /usr/lib/python3.11/importlib/_bootstrap_external.py in exec_module(self, module) /usr/lib/python3.11/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds) /usr/local/lib/python3.11/dist-packages/transformers/pipelines/__init__.py in <module> 46 ) ---> 47 from .audio_classification import AudioClassificationPipeline 48 from .automatic_speech_recognition import AutomaticSpeechRecognitionPipeline /usr/local/lib/python3.11/dist-packages/transformers/pipelines/audio_classification.py in <module> 20 from ..utils import add_end_docstrings, is_torch_available, is_torchaudio_available, logging ---> 21 from .base import Pipeline, build_pipeline_init_args 22 /usr/local/lib/python3.11/dist-packages/transformers/pipelines/base.py in <module> 33 from ..image_processing_utils import BaseImageProcessor ---> 34 from ..modelcard import ModelCard 35 from ..models.auto.configuration_auto import AutoConfig /usr/local/lib/python3.11/dist-packages/transformers/modelcard.py in <module> 47 ) ---> 48 from .training_args import ParallelMode 49 from .utils import ( /usr/local/lib/python3.11/dist-packages/transformers/training_args.py in <module> 72 if is_accelerate_available(): ---> 73 from accelerate.state import AcceleratorState, PartialState 74 from accelerate.utils import DistributedType /usr/local/lib/python3.11/dist-packages/accelerate/__init__.py in <module> 15 ---> 16 from .accelerator import Accelerator 17 from .big_modeling import ( /usr/local/lib/python3.11/dist-packages/accelerate/accelerator.py in <module> 35 ---> 36 from .checkpointing import load_accelerator_state, load_custom_state, save_accelerator_state, save_custom_state 37 from .data_loader import DataLoaderDispatcher, prepare_data_loader, skip_first_batches /usr/local/lib/python3.11/dist-packages/accelerate/checkpointing.py in <module> 21 ---> 22 from .utils import ( 23 MODEL_NAME, /usr/local/lib/python3.11/dist-packages/accelerate/utils/__init__.py in <module> 34 ) ---> 35 from .dataclasses import ( 36 AORecipeKwargs, /usr/local/lib/python3.11/dist-packages/accelerate/utils/dataclasses.py in <module> 33 ---> 34 from .constants import ( 35 BETA_TP_AVAILABLE_PYTORCH_VERSION, ImportError: cannot import name 'FSDP2_PYTORCH_VERSION' from 'accelerate.utils.constants' (/usr/local/lib/python3.11/dist-packages/accelerate/utils/constants.py) The above exception was the direct cause of the following exception: RuntimeError Traceback (most recent call last) /tmp/ipykernel_129/2705754419.py in <cell line: 0>() 15 # load the model pipeline on gpu:0 16 # pipe = transformers.pipeline(model='sarvamai/shuka_v1', trust_remote_code=True, device=0, torch_dtype='bfloat16') ---> 17 from transformers import pipeline 18 19 pipe = pipeline( /usr/lib/python3.11/importlib/_bootstrap.py in _handle_fromlist(module, fromlist, import_, recursive) /usr/local/lib/python3.11/dist-packages/transformers/utils/import_utils.py in __getattr__(self, name) 1523 value = self._get_module(name) 1524 elif name in self._class_to_module.keys(): -> 1525 module = self._get_module(self._class_to_module[name]) 1526 value = getattr(module, name) 1527 else: /usr/local/lib/python3.11/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name) 1535 return importlib.import_module("." + module_name, self.__name__) 1536 except Exception as e: -> 1537 raise RuntimeError( 1538 f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its" 1539 f" traceback):\n{e}" RuntimeError: Failed to import transformers.pipelines because of the following error (look up to see its traceback): cannot import name 'FSDP2_PYTORCH_VERSION' from 'accelerate.utils.constants' (/usr/local/lib/python3.11/dist-packages/accelerate/utils/constants.py)
{ "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/39260/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/39260/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/39259
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39259/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39259/comments
https://api.github.com/repos/huggingface/transformers/issues/39259/events
https://github.com/huggingface/transformers/pull/39259
3,209,640,901
PR_kwDOCUB6oc6dyzOY
39,259
fix failing `test_sdpa_can_dispatch_on_flash`
{ "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-07-07T16:34:01
2025-07-13T11:25:06
2025-07-11T14:30:56
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39259", "html_url": "https://github.com/huggingface/transformers/pull/39259", "diff_url": "https://github.com/huggingface/transformers/pull/39259.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39259.patch", "merged_at": "2025-07-11T14:30:56" }
# What does this PR do?
{ "login": "ArthurZucker", "id": 48595927, "node_id": "MDQ6VXNlcjQ4NTk1OTI3", "avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ArthurZucker", "html_url": "https://github.com/ArthurZucker", "followers_url": "https://api.github.com/users/ArthurZucker/followers", "following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}", "gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}", "starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions", "organizations_url": "https://api.github.com/users/ArthurZucker/orgs", "repos_url": "https://api.github.com/users/ArthurZucker/repos", "events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}", "received_events_url": "https://api.github.com/users/ArthurZucker/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39259/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/39259/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39258
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39258/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39258/comments
https://api.github.com/repos/huggingface/transformers/issues/39258/events
https://github.com/huggingface/transformers/pull/39258
3,209,588,658
PR_kwDOCUB6oc6dynhS
39,258
[pagged-attention] fix off-by-1 error in pagged attention generation
{ "login": "kashif", "id": 8100, "node_id": "MDQ6VXNlcjgxMDA=", "avatar_url": "https://avatars.githubusercontent.com/u/8100?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kashif", "html_url": "https://github.com/kashif", "followers_url": "https://api.github.com/users/kashif/followers", "following_url": "https://api.github.com/users/kashif/following{/other_user}", "gists_url": "https://api.github.com/users/kashif/gists{/gist_id}", "starred_url": "https://api.github.com/users/kashif/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kashif/subscriptions", "organizations_url": "https://api.github.com/users/kashif/orgs", "repos_url": "https://api.github.com/users/kashif/repos", "events_url": "https://api.github.com/users/kashif/events{/privacy}", "received_events_url": "https://api.github.com/users/kashif/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-07-07T16:18:35
2025-07-11T10:49:56
2025-07-08T10:34:23
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39258", "html_url": "https://github.com/huggingface/transformers/pull/39258", "diff_url": "https://github.com/huggingface/transformers/pull/39258.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39258.patch", "merged_at": "2025-07-08T10:34:23" }
# What does this PR do? we were adding the token first and then doing a check, leading to the number of tokens being 1 more than the`max_new_tokens` This fix reorders the logic to: 1. Check completion conditions (EOS token or max length) before adding the token 1. Only add the token if we haven't exceeded the limit (with special handling for EOS tokens) 1. Terminate the request appropriately ## 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": "kashif", "id": 8100, "node_id": "MDQ6VXNlcjgxMDA=", "avatar_url": "https://avatars.githubusercontent.com/u/8100?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kashif", "html_url": "https://github.com/kashif", "followers_url": "https://api.github.com/users/kashif/followers", "following_url": "https://api.github.com/users/kashif/following{/other_user}", "gists_url": "https://api.github.com/users/kashif/gists{/gist_id}", "starred_url": "https://api.github.com/users/kashif/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kashif/subscriptions", "organizations_url": "https://api.github.com/users/kashif/orgs", "repos_url": "https://api.github.com/users/kashif/repos", "events_url": "https://api.github.com/users/kashif/events{/privacy}", "received_events_url": "https://api.github.com/users/kashif/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39258/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/39258/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39257
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39257/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39257/comments
https://api.github.com/repos/huggingface/transformers/issues/39257/events
https://github.com/huggingface/transformers/pull/39257
3,209,565,516
PR_kwDOCUB6oc6dyimt
39,257
Fix to tuple conversion with config
{ "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-07-07T16:10:43
2025-07-07T16:23:42
null
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39257", "html_url": "https://github.com/huggingface/transformers/pull/39257", "diff_url": "https://github.com/huggingface/transformers/pull/39257.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39257.patch", "merged_at": null }
# What does this PR do? setting `return_dict=False` with config fails for models with sub-models wrapped with `can_return_tuple` or `check_model_inputs` ```py import torch from transformers import LlamaConfig, LlamaForCausalLM config = LlamaConfig(vocab_size=256, hidden_size=128, num_hidden_layers=2, num_attention_heads=4, intermediate_size=256) model = LlamaForCausalLM(config) # default: ModelOutput input_ids = torch.tensor([[0, 1, 2, 3]]) with torch.no_grad(): output = model(input_ids) print(output) # passing return_dict=False as a kwarg input_ids = torch.tensor([[0, 1, 2, 3]]) with torch.no_grad(): output = model(input_ids, return_dict=False) print(output) # ERROR: setting return_dict=False in the config model.config.return_dict = False with torch.no_grad(): output = model(input_ids) print(output) # Traceback (most recent call last): # File "/home/ubuntu/projects/transformers/test_llama_small.py", line 17, in <module> # output = model(input_ids) # File "/home/ubuntu/projects/transformers/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl # return self._call_impl(*args, **kwargs) # File "/home/ubuntu/projects/transformers/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl # return forward_call(*args, **kwargs) # File "/home/ubuntu/projects/transformers/src/transformers/utils/generic.py", line 962, in wrapper # output = func(self, *args, **kwargs) # File "/home/ubuntu/projects/transformers/src/transformers/models/llama/modeling_llama.py", line 506, in forward # hidden_states = outputs.last_hidden_state # AttributeError: 'tuple' object has no attribute 'last_hidden_state' ```
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39257/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/39257/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39256
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39256/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39256/comments
https://api.github.com/repos/huggingface/transformers/issues/39256/events
https://github.com/huggingface/transformers/issues/39256
3,209,435,987
I_kwDOCUB6oc6_TBtT
39,256
ModuleNotFoundError: No module named 'habana_frameworks.torch'
{ "login": "orkungedik", "id": 32071110, "node_id": "MDQ6VXNlcjMyMDcxMTEw", "avatar_url": "https://avatars.githubusercontent.com/u/32071110?v=4", "gravatar_id": "", "url": "https://api.github.com/users/orkungedik", "html_url": "https://github.com/orkungedik", "followers_url": "https://api.github.com/users/orkungedik/followers", "following_url": "https://api.github.com/users/orkungedik/following{/other_user}", "gists_url": "https://api.github.com/users/orkungedik/gists{/gist_id}", "starred_url": "https://api.github.com/users/orkungedik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/orkungedik/subscriptions", "organizations_url": "https://api.github.com/users/orkungedik/orgs", "repos_url": "https://api.github.com/users/orkungedik/repos", "events_url": "https://api.github.com/users/orkungedik/events{/privacy}", "received_events_url": "https://api.github.com/users/orkungedik/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-07-07T15:25:41
2025-07-21T17:11:43
2025-07-07T19:09:48
NONE
null
null
null
null
### System Info Hi, I finetuned unsloth/Meta-Llama-3.1-8B-Instruct model and tried to run code below on CPU; ``` model_name = "orkungedik/ege-8b-1.0" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained(model_name,torch_dtype="auto", device_map="auto") ``` And getting error below; > File /usr/local/lib/python3.10/dist-packages/neural_compressor/torch/utils/environ.py:67 65 if is_package_available("habana_frameworks"): 66 _hpex_available = True ---> 67 import habana_frameworks.torch.hpex # pylint: disable=E0401 68 else: 69 _hpex_available = False ModuleNotFoundError: No module named 'habana_frameworks.torch' To solve this problem executed commands below; pip install --upgrade neural-compressor pip install habana-tensorflow But nothing changed. What may cause this problem? Thank you ### 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 Execute code on CPU based system and run provided source code ### Expected behavior Loading model without a problem
{ "login": "orkungedik", "id": 32071110, "node_id": "MDQ6VXNlcjMyMDcxMTEw", "avatar_url": "https://avatars.githubusercontent.com/u/32071110?v=4", "gravatar_id": "", "url": "https://api.github.com/users/orkungedik", "html_url": "https://github.com/orkungedik", "followers_url": "https://api.github.com/users/orkungedik/followers", "following_url": "https://api.github.com/users/orkungedik/following{/other_user}", "gists_url": "https://api.github.com/users/orkungedik/gists{/gist_id}", "starred_url": "https://api.github.com/users/orkungedik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/orkungedik/subscriptions", "organizations_url": "https://api.github.com/users/orkungedik/orgs", "repos_url": "https://api.github.com/users/orkungedik/repos", "events_url": "https://api.github.com/users/orkungedik/events{/privacy}", "received_events_url": "https://api.github.com/users/orkungedik/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39256/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/39256/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/39255
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39255/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39255/comments
https://api.github.com/repos/huggingface/transformers/issues/39255/events
https://github.com/huggingface/transformers/pull/39255
3,209,387,449
PR_kwDOCUB6oc6dx8bD
39,255
remove broken block
{ "login": "molbap", "id": 39954772, "node_id": "MDQ6VXNlcjM5OTU0Nzcy", "avatar_url": "https://avatars.githubusercontent.com/u/39954772?v=4", "gravatar_id": "", "url": "https://api.github.com/users/molbap", "html_url": "https://github.com/molbap", "followers_url": "https://api.github.com/users/molbap/followers", "following_url": "https://api.github.com/users/molbap/following{/other_user}", "gists_url": "https://api.github.com/users/molbap/gists{/gist_id}", "starred_url": "https://api.github.com/users/molbap/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/molbap/subscriptions", "organizations_url": "https://api.github.com/users/molbap/orgs", "repos_url": "https://api.github.com/users/molbap/repos", "events_url": "https://api.github.com/users/molbap/events{/privacy}", "received_events_url": "https://api.github.com/users/molbap/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T15:09:24
2025-07-08T08:41:46
2025-07-08T08:41:44
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39255", "html_url": "https://github.com/huggingface/transformers/pull/39255", "diff_url": "https://github.com/huggingface/transformers/pull/39255.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39255.patch", "merged_at": "2025-07-08T08:41:44" }
# What does this PR do? Removes an unused (and broken) block in modular model converter. Tested on a few modular conversions, as long as we don't use `return super().<...method...>` it will not cause issues.
{ "login": "molbap", "id": 39954772, "node_id": "MDQ6VXNlcjM5OTU0Nzcy", "avatar_url": "https://avatars.githubusercontent.com/u/39954772?v=4", "gravatar_id": "", "url": "https://api.github.com/users/molbap", "html_url": "https://github.com/molbap", "followers_url": "https://api.github.com/users/molbap/followers", "following_url": "https://api.github.com/users/molbap/following{/other_user}", "gists_url": "https://api.github.com/users/molbap/gists{/gist_id}", "starred_url": "https://api.github.com/users/molbap/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/molbap/subscriptions", "organizations_url": "https://api.github.com/users/molbap/orgs", "repos_url": "https://api.github.com/users/molbap/repos", "events_url": "https://api.github.com/users/molbap/events{/privacy}", "received_events_url": "https://api.github.com/users/molbap/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39255/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/39255/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39254
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39254/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39254/comments
https://api.github.com/repos/huggingface/transformers/issues/39254/events
https://github.com/huggingface/transformers/pull/39254
3,209,375,893
PR_kwDOCUB6oc6dx5-L
39,254
fix some flaky tests in `tests/generation/test_utils.py`
{ "login": "ydshieh", "id": 2521628, "node_id": "MDQ6VXNlcjI1MjE2Mjg=", "avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ydshieh", "html_url": "https://github.com/ydshieh", "followers_url": "https://api.github.com/users/ydshieh/followers", "following_url": "https://api.github.com/users/ydshieh/following{/other_user}", "gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}", "starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions", "organizations_url": "https://api.github.com/users/ydshieh/orgs", "repos_url": "https://api.github.com/users/ydshieh/repos", "events_url": "https://api.github.com/users/ydshieh/events{/privacy}", "received_events_url": "https://api.github.com/users/ydshieh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T15:05:24
2025-07-07T17:49:44
2025-07-07T17:49:42
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39254", "html_url": "https://github.com/huggingface/transformers/pull/39254", "diff_url": "https://github.com/huggingface/transformers/pull/39254.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39254.patch", "merged_at": "2025-07-07T17:49:42" }
# What does this PR do? Use the helper functions to set the norm layers to have eps=1.0 to avoid numerical issues. Now the following pass > RUN_SLOW=1 python3 -m pytest -v -n 6 --flake-finder --flake-runs=500 tests/models/kosmos2/test_modeling_kosmos2.py::Kosmos2ModelTest::test_eager_matches_sdpa_generate > RUN_SLOW=1 python3 -m pytest -v -n 6 --flake-finder --flake-runs=500 tests/models/glm4v/test_modeling_glm4v.py::Glm4vModelTest -k "test_generate_from_inputs_embeds" The following > RUN_SLOW=1 python3 -m pytest -v -n 6 --flake-finder --flake-runs=100 tests/models/csm/test_modeling_csm.py::CsmForConditionalGenerationTest::test_eager_matches_sdpa_generate pass, while on `main` it has 22 failures. > RUN_SLOW=1 python3 -m pytest -v -n 6 --flake-finder --flake-runs=500 tests/models/csm/test_modeling_csm.py::CsmForConditionalGenerationTest::test_eager_matches_sdpa_generate still has 1 failure.
{ "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/39254/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/39254/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39253
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39253/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39253/comments
https://api.github.com/repos/huggingface/transformers/issues/39253/events
https://github.com/huggingface/transformers/pull/39253
3,209,324,321
PR_kwDOCUB6oc6dxu9K
39,253
Add trust_remote_code in LightGlueConfig
{ "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 }
[ { "id": 5769473378, "node_id": "LA_kwDOCUB6oc8AAAABV-MtYg", "url": "https://api.github.com/repos/huggingface/transformers/labels/Vision", "name": "Vision", "color": "C079EF", "default": false, "description": "" } ]
closed
false
null
[]
null
[]
2025-07-07T14:48:58
2025-07-08T15:12:11
2025-07-08T15:03:05
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39253", "html_url": "https://github.com/huggingface/transformers/pull/39253", "diff_url": "https://github.com/huggingface/transformers/pull/39253.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39253.patch", "merged_at": "2025-07-08T15:03:04" }
# What does this PR do? Add trust_remote_code parameter to LightGlue config so that LightGlue can be used with other not implemented keypoint detectors than SuperPoint. With `from_pretrained`, `trust_remote_code` is not provided to the config, so I had to include it into the config itself as an attribute. Discussed on Slack. ## Who can review? @qubvel
{ "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/39253/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/39253/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39252
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39252/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39252/comments
https://api.github.com/repos/huggingface/transformers/issues/39252/events
https://github.com/huggingface/transformers/pull/39252
3,209,284,560
PR_kwDOCUB6oc6dxmaI
39,252
Simplify Mixtral and its modular children
{ "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-07-07T14:36:13
2025-07-07T17:40:42
2025-07-07T17:40:41
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39252", "html_url": "https://github.com/huggingface/transformers/pull/39252", "diff_url": "https://github.com/huggingface/transformers/pull/39252.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39252.patch", "merged_at": "2025-07-07T17:40:41" }
# What does this PR do? As per the title. This is useful for modular with models to be released
{ "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/39252/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/39252/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39251
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39251/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39251/comments
https://api.github.com/repos/huggingface/transformers/issues/39251/events
https://github.com/huggingface/transformers/pull/39251
3,209,144,080
PR_kwDOCUB6oc6dxIFn
39,251
Fix slow test_moshika_greedy_unconditional_fp16
{ "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 }
[]
open
false
null
[]
null
[]
2025-07-07T13:55:15
2025-09-02T14:34:38
null
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39251", "html_url": "https://github.com/huggingface/transformers/pull/39251", "diff_url": "https://github.com/huggingface/transformers/pull/39251.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39251.patch", "merged_at": null }
Fix #38725 Coming from #38725, previously, e18f233f6c8cba029324e2868fb68abdaf6badf3 attempted to fix the default attention mask issue that appeated with #34464, but it was still failing the slow test `tests/models/moshi/test_modeling_moshi.py::MoshiIntegrationTests::test_moshika_greedy_unconditional_fp16` History from git bisect: - https://github.com/huggingface/transformers/blob/84a6789145c3d728f2e405d31e9a35df5d74f05c/src/transformers/modeling_utils.py#L1413 from #34873 broke the types for some commits, then it was fixed in a later commit. - auto-compilation on generate also made it fail for some commits, it was also corrected after some commits. - Then #35993 broke here the test (didnt have the -1): https://github.com/huggingface/transformers/blob/36bf1d2324ee8a971763eabc2950a044d5eff3fa/src/transformers/generation/utils.py#L2090 - And #37873 modified sliding window behaviour breaking it as well (>= to >) https://github.com/huggingface/transformers/blob/1b222903c3e1cfd9492d75e4b2548aa8bd458674/src/transformers/cache_utils.py#L1740 Setting cache_implementation="dynamic" makes the test pass, but the sliding window cache should not behave different. I believe this is due to the depth decoder being window 8 by default, but audio is confusing to me. This PR is not a fix: the modeling code should be changed to accomodate what I highlight in the diff cc @eustlb @ydshieh
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39251/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/39251/timeline
null
null
null
null
true
false
https://api.github.com/repos/huggingface/transformers/issues/39250
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39250/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39250/comments
https://api.github.com/repos/huggingface/transformers/issues/39250/events
https://github.com/huggingface/transformers/pull/39250
3,209,108,210
PR_kwDOCUB6oc6dxAQs
39,250
Fix license text, duplicate assignment, and typo in constant names
{ "login": "gudwls215", "id": 96422648, "node_id": "U_kgDOBb9K-A", "avatar_url": "https://avatars.githubusercontent.com/u/96422648?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gudwls215", "html_url": "https://github.com/gudwls215", "followers_url": "https://api.github.com/users/gudwls215/followers", "following_url": "https://api.github.com/users/gudwls215/following{/other_user}", "gists_url": "https://api.github.com/users/gudwls215/gists{/gist_id}", "starred_url": "https://api.github.com/users/gudwls215/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gudwls215/subscriptions", "organizations_url": "https://api.github.com/users/gudwls215/orgs", "repos_url": "https://api.github.com/users/gudwls215/repos", "events_url": "https://api.github.com/users/gudwls215/events{/privacy}", "received_events_url": "https://api.github.com/users/gudwls215/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T13:44:57
2025-07-08T08:20:52
2025-07-08T08:20:52
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39250", "html_url": "https://github.com/huggingface/transformers/pull/39250", "diff_url": "https://github.com/huggingface/transformers/pull/39250.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39250.patch", "merged_at": "2025-07-08T08:20:52" }
# What does this PR do? This PR fixes several minor but important issues across the codebase: 1. **License text completion** in Italian documentation 2. **Code syntax error** in Perceiver model conversion script 3. **Typo in metadata constant** name ## Changes Made ### πŸ“„ Documentation Fix - **File**: `docs/source/it/perf_train_special.md` - **Issue**: Incomplete Apache License 2.0 text (missing ending) - **Fix**: Added the missing license text ending ### 🐍 Code Syntax Fix - **File**: `src/transformers/models/perceiver/convert_perceiver_haiku_to_pytorch.py` - **Issue**: Duplicate assignment `name = name = name.replace(...)` - **Fix**: Removed duplicate assignment to `name = name.replace(...)` ### πŸ”§ Metadata Constant Fix - **File**: `utils/update_metadata.py` - **Issue**: Typo in constant name `"MODEL_FOR_FOR_VISION_2_SEQ_MAPPING_NAMES"` (duplicate "FOR") - **Fix**: Corrected to `"MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES"` ## Testing - All changes are minor text/syntax fixes - No functional changes to model behavior - Verified syntax correctness in Python files ## 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. (N/A - minor fixes) - [x] Did you make sure to update the documentation with your changes? (Documentation fix included) - [x] Did you write any new necessary tests? (N/A - no functional changes) ## Who can review? @stevhliu (Documentation fixes) or any community member - these are minor text/syntax corrections.
{ "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/39250/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/39250/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39249
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39249/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39249/comments
https://api.github.com/repos/huggingface/transformers/issues/39249/events
https://github.com/huggingface/transformers/issues/39249
3,208,384,440
I_kwDOCUB6oc6_PA-4
39,249
OSError: Tensor parallel is only supported for `torch>=2.5`
{ "login": "mxjmtxrm", "id": 167944756, "node_id": "U_kgDOCgKiNA", "avatar_url": "https://avatars.githubusercontent.com/u/167944756?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mxjmtxrm", "html_url": "https://github.com/mxjmtxrm", "followers_url": "https://api.github.com/users/mxjmtxrm/followers", "following_url": "https://api.github.com/users/mxjmtxrm/following{/other_user}", "gists_url": "https://api.github.com/users/mxjmtxrm/gists{/gist_id}", "starred_url": "https://api.github.com/users/mxjmtxrm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mxjmtxrm/subscriptions", "organizations_url": "https://api.github.com/users/mxjmtxrm/orgs", "repos_url": "https://api.github.com/users/mxjmtxrm/repos", "events_url": "https://api.github.com/users/mxjmtxrm/events{/privacy}", "received_events_url": "https://api.github.com/users/mxjmtxrm/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-07-07T10:16:00
2025-07-08T11:37:36
2025-07-08T11:37:36
NONE
null
null
null
null
### System Info - `transformers` version: 4.53.1 - Platform: Linux-5.15.0-105-generic-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.33.2 - Safetensors version: 0.4.5 - Accelerate version: 1.2.1 - Accelerate config: not found - DeepSpeed version: 0.17.1 - PyTorch version (accelerator?): 2.5.0a0+e000cf0ad9.nv24.10 (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?: <fill in> - Using GPU in script?: <fill in> - GPU type: NVIDIA H100 80GB HBM3 ### Who can help? @SunMarc @zach-huggingface ### 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 Hi, I met the following error when I tried to finetune a model using run_clm.py. ``` Traceback (most recent call last): File "/workspace/run_clm.py", line 679, in <module> main() File "/workspace/run_clm.py", line 235, in main model = AutoModelForCausalLM.from_pretrained( File "/usr/local/lib/python3.10/dist-packages/transformers/models/auto/auto_factory.py", line 593, in from_pretrained return model_class.from_pretrained( File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 311, in _wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 4443, in from_pretrained tp_plan, device_map, device_mesh = initialize_tensor_parallelism(tp_plan, tp_size=None) File "/usr/local/lib/python3.10/dist-packages/transformers/integrations/tensor_parallel.py", line 49, in initialize_tensor_parallelism raise OSError("Tensor parallel is only supported for `torch>=2.5`.") OSError: Tensor parallel is only supported for `torch>=2.5`. ``` The torch version is `PyTorch version (accelerator?): 2.5.0a0+e000cf0ad9.nv24.10 (CUDA)`. The startup command is as follows: ``` accelerate launch --config_file "deepspeeds.yaml" run_clm.py \ --do_train \ --do_eval \ --model_name_or_path model_to_ft \ --trust_remote_code True \ --torch_dtype auto \ --train_file train.json \ --validation_file val.json \ --streaming True \ --block_size 8192 \ --output_dir ./output \ --weight_decay 0.01 \ --learning_rate 5e-6 \ --lr_scheduler_type "cosine" \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --gradient_accumulation_steps 16 \ --gradient_checkpointing True \ --gradient_checkpointing_kwargs '{"use_reentrant": true}' \ --max_grad_norm 0.5 \ --warmup_ratio 0.03 \ --bf16 \ --num_train_epochs 1 \ --aux_lambda 1e-5 \ --eval_strategy "steps" \ --eval_steps 5000 \ --save_strategy "steps" \ --save_steps 1000 \ --report_to "tensorboard" \ --save_total_limit 2 \ --logging_steps 10 \ --log_level "info" \ --include_num_input_tokens_seen True \ --save_only_model False ``` ### Expected behavior I didn't set any parameters related to TP, so why is TP being used by default? How can I resolve this issue?
{ "login": "mxjmtxrm", "id": 167944756, "node_id": "U_kgDOCgKiNA", "avatar_url": "https://avatars.githubusercontent.com/u/167944756?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mxjmtxrm", "html_url": "https://github.com/mxjmtxrm", "followers_url": "https://api.github.com/users/mxjmtxrm/followers", "following_url": "https://api.github.com/users/mxjmtxrm/following{/other_user}", "gists_url": "https://api.github.com/users/mxjmtxrm/gists{/gist_id}", "starred_url": "https://api.github.com/users/mxjmtxrm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mxjmtxrm/subscriptions", "organizations_url": "https://api.github.com/users/mxjmtxrm/orgs", "repos_url": "https://api.github.com/users/mxjmtxrm/repos", "events_url": "https://api.github.com/users/mxjmtxrm/events{/privacy}", "received_events_url": "https://api.github.com/users/mxjmtxrm/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39249/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/39249/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/39248
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39248/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39248/comments
https://api.github.com/repos/huggingface/transformers/issues/39248/events
https://github.com/huggingface/transformers/pull/39248
3,208,184,949
PR_kwDOCUB6oc6dt1Us
39,248
Skip `test_eager_matches sdpa generate` and update an integration test for blip-like models
{ "login": "ydshieh", "id": 2521628, "node_id": "MDQ6VXNlcjI1MjE2Mjg=", "avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ydshieh", "html_url": "https://github.com/ydshieh", "followers_url": "https://api.github.com/users/ydshieh/followers", "following_url": "https://api.github.com/users/ydshieh/following{/other_user}", "gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}", "starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions", "organizations_url": "https://api.github.com/users/ydshieh/orgs", "repos_url": "https://api.github.com/users/ydshieh/repos", "events_url": "https://api.github.com/users/ydshieh/events{/privacy}", "received_events_url": "https://api.github.com/users/ydshieh/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T09:13:34
2025-07-08T08:38:29
2025-07-08T08:38:25
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39248", "html_url": "https://github.com/huggingface/transformers/pull/39248", "diff_url": "https://github.com/huggingface/transformers/pull/39248.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39248.patch", "merged_at": "2025-07-08T08:38:25" }
# What does this PR do? For skip, see [this comment](https://github.com/huggingface/transformers/pull/38510#discussion_r2121138005). Let's make the CI report clean though for now.
{ "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/39248/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/39248/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39247
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39247/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39247/comments
https://api.github.com/repos/huggingface/transformers/issues/39247/events
https://github.com/huggingface/transformers/pull/39247
3,208,083,286
PR_kwDOCUB6oc6dtfpW
39,247
Glm 4 doc
{ "login": "zRzRzRzRzRzRzR", "id": 93239683, "node_id": "U_kgDOBY65gw", "avatar_url": "https://avatars.githubusercontent.com/u/93239683?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zRzRzRzRzRzRzR", "html_url": "https://github.com/zRzRzRzRzRzRzR", "followers_url": "https://api.github.com/users/zRzRzRzRzRzRzR/followers", "following_url": "https://api.github.com/users/zRzRzRzRzRzRzR/following{/other_user}", "gists_url": "https://api.github.com/users/zRzRzRzRzRzRzR/gists{/gist_id}", "starred_url": "https://api.github.com/users/zRzRzRzRzRzRzR/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zRzRzRzRzRzRzR/subscriptions", "organizations_url": "https://api.github.com/users/zRzRzRzRzRzRzR/orgs", "repos_url": "https://api.github.com/users/zRzRzRzRzRzRzR/repos", "events_url": "https://api.github.com/users/zRzRzRzRzRzRzR/events{/privacy}", "received_events_url": "https://api.github.com/users/zRzRzRzRzRzRzR/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T08:44:28
2025-07-14T04:39:23
2025-07-08T06:22:04
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39247", "html_url": "https://github.com/huggingface/transformers/pull/39247", "diff_url": "https://github.com/huggingface/transformers/pull/39247.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39247.patch", "merged_at": "2025-07-08T06:22:04" }
Improve the introduction documentation for GLM-4-0414 and GLM-4.1V. Improve the pytest testing for GLM-4.1V.
{ "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/39247/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/39247/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39246
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39246/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39246/comments
https://api.github.com/repos/huggingface/transformers/issues/39246/events
https://github.com/huggingface/transformers/pull/39246
3,207,996,206
PR_kwDOCUB6oc6dtNOK
39,246
enable xpu on kv-cache and hqq doc
{ "login": "jiqing-feng", "id": 107918818, "node_id": "U_kgDOBm614g", "avatar_url": "https://avatars.githubusercontent.com/u/107918818?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jiqing-feng", "html_url": "https://github.com/jiqing-feng", "followers_url": "https://api.github.com/users/jiqing-feng/followers", "following_url": "https://api.github.com/users/jiqing-feng/following{/other_user}", "gists_url": "https://api.github.com/users/jiqing-feng/gists{/gist_id}", "starred_url": "https://api.github.com/users/jiqing-feng/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jiqing-feng/subscriptions", "organizations_url": "https://api.github.com/users/jiqing-feng/orgs", "repos_url": "https://api.github.com/users/jiqing-feng/repos", "events_url": "https://api.github.com/users/jiqing-feng/events{/privacy}", "received_events_url": "https://api.github.com/users/jiqing-feng/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T08:13:41
2025-07-07T13:12:33
2025-07-07T13:12:02
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39246", "html_url": "https://github.com/huggingface/transformers/pull/39246", "diff_url": "https://github.com/huggingface/transformers/pull/39246.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39246.patch", "merged_at": "2025-07-07T13:12:02" }
Enable xpu on kv-cache and hqq doc. The previous quantized kv-cache usage is out-of-date, I have updated it and verified it on both A100 and XPU.
{ "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/39246/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/39246/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39245
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39245/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39245/comments
https://api.github.com/repos/huggingface/transformers/issues/39245/events
https://github.com/huggingface/transformers/pull/39245
3,207,925,464
PR_kwDOCUB6oc6ds9z0
39,245
Update tiny-agents example
{ "login": "Wauplin", "id": 11801849, "node_id": "MDQ6VXNlcjExODAxODQ5", "avatar_url": "https://avatars.githubusercontent.com/u/11801849?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Wauplin", "html_url": "https://github.com/Wauplin", "followers_url": "https://api.github.com/users/Wauplin/followers", "following_url": "https://api.github.com/users/Wauplin/following{/other_user}", "gists_url": "https://api.github.com/users/Wauplin/gists{/gist_id}", "starred_url": "https://api.github.com/users/Wauplin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Wauplin/subscriptions", "organizations_url": "https://api.github.com/users/Wauplin/orgs", "repos_url": "https://api.github.com/users/Wauplin/repos", "events_url": "https://api.github.com/users/Wauplin/events{/privacy}", "received_events_url": "https://api.github.com/users/Wauplin/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T07:50:34
2025-07-07T13:58:38
2025-07-07T13:58:36
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39245", "html_url": "https://github.com/huggingface/transformers/pull/39245", "diff_url": "https://github.com/huggingface/transformers/pull/39245.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39245.patch", "merged_at": "2025-07-07T13:58:36" }
Fix docs example after https://github.com/huggingface/huggingface_hub/pull/3166 / https://github.com/huggingface/huggingface.js/pull/1556. Since release [0.33.2](https://github.com/huggingface/huggingface_hub/releases/tag/v0.33.2) `tiny-agents` config follow VSCode format. We made the change without a proper deprecation warning as it's still experimental and we wanted to harmonize with VSCode as quickly as possible (to avoid future conflicts). Related PRs: - https://github.com/huggingface/hub-docs/pull/1816 - https://github.com/huggingface/transformers/pull/39245 - https://github.com/huggingface/huggingface_hub/pull/3205 - https://github.com/huggingface/huggingface.js/pull/1599
{ "login": "Wauplin", "id": 11801849, "node_id": "MDQ6VXNlcjExODAxODQ5", "avatar_url": "https://avatars.githubusercontent.com/u/11801849?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Wauplin", "html_url": "https://github.com/Wauplin", "followers_url": "https://api.github.com/users/Wauplin/followers", "following_url": "https://api.github.com/users/Wauplin/following{/other_user}", "gists_url": "https://api.github.com/users/Wauplin/gists{/gist_id}", "starred_url": "https://api.github.com/users/Wauplin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Wauplin/subscriptions", "organizations_url": "https://api.github.com/users/Wauplin/orgs", "repos_url": "https://api.github.com/users/Wauplin/repos", "events_url": "https://api.github.com/users/Wauplin/events{/privacy}", "received_events_url": "https://api.github.com/users/Wauplin/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39245/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/39245/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39244
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39244/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39244/comments
https://api.github.com/repos/huggingface/transformers/issues/39244/events
https://github.com/huggingface/transformers/pull/39244
3,207,733,609
PR_kwDOCUB6oc6dsUg5
39,244
Fix missing fast tokenizer/image_processor in whisper/qwen2.5-omni processor
{ "login": "Isotr0py", "id": 41363108, "node_id": "MDQ6VXNlcjQxMzYzMTA4", "avatar_url": "https://avatars.githubusercontent.com/u/41363108?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Isotr0py", "html_url": "https://github.com/Isotr0py", "followers_url": "https://api.github.com/users/Isotr0py/followers", "following_url": "https://api.github.com/users/Isotr0py/following{/other_user}", "gists_url": "https://api.github.com/users/Isotr0py/gists{/gist_id}", "starred_url": "https://api.github.com/users/Isotr0py/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Isotr0py/subscriptions", "organizations_url": "https://api.github.com/users/Isotr0py/orgs", "repos_url": "https://api.github.com/users/Isotr0py/repos", "events_url": "https://api.github.com/users/Isotr0py/events{/privacy}", "received_events_url": "https://api.github.com/users/Isotr0py/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T06:38:53
2025-07-22T04:11:26
2025-07-07T11:54:18
COLLABORATOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39244", "html_url": "https://github.com/huggingface/transformers/pull/39244", "diff_url": "https://github.com/huggingface/transformers/pull/39244.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39244.patch", "merged_at": "2025-07-07T11:54:18" }
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change. Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost. --> <!-- Remove if not applicable --> Fixes https://github.com/vllm-project/vllm/issues/20224 - Fix missing `WhisperTokenizerFast` in whisper processor ## 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": "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/39244/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/39244/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39243
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39243/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39243/comments
https://api.github.com/repos/huggingface/transformers/issues/39243/events
https://github.com/huggingface/transformers/pull/39243
3,207,623,582
PR_kwDOCUB6oc6dr9Xo
39,243
depreated kernels of ms_deform_attn support fp16
{ "login": "chagmgang", "id": 37325825, "node_id": "MDQ6VXNlcjM3MzI1ODI1", "avatar_url": "https://avatars.githubusercontent.com/u/37325825?v=4", "gravatar_id": "", "url": "https://api.github.com/users/chagmgang", "html_url": "https://github.com/chagmgang", "followers_url": "https://api.github.com/users/chagmgang/followers", "following_url": "https://api.github.com/users/chagmgang/following{/other_user}", "gists_url": "https://api.github.com/users/chagmgang/gists{/gist_id}", "starred_url": "https://api.github.com/users/chagmgang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chagmgang/subscriptions", "organizations_url": "https://api.github.com/users/chagmgang/orgs", "repos_url": "https://api.github.com/users/chagmgang/repos", "events_url": "https://api.github.com/users/chagmgang/events{/privacy}", "received_events_url": "https://api.github.com/users/chagmgang/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-07T05:43:20
2025-07-08T06:48:54
2025-07-08T06:48:54
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39243", "html_url": "https://github.com/huggingface/transformers/pull/39243", "diff_url": "https://github.com/huggingface/transformers/pull/39243.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39243.patch", "merged_at": null }
# What does this PR do? * This PR for deprecated kernels of ms_deform_attn support fp16. <!-- Remove if not applicable --> ## Who can review? @amyeroberts
{ "login": "chagmgang", "id": 37325825, "node_id": "MDQ6VXNlcjM3MzI1ODI1", "avatar_url": "https://avatars.githubusercontent.com/u/37325825?v=4", "gravatar_id": "", "url": "https://api.github.com/users/chagmgang", "html_url": "https://github.com/chagmgang", "followers_url": "https://api.github.com/users/chagmgang/followers", "following_url": "https://api.github.com/users/chagmgang/following{/other_user}", "gists_url": "https://api.github.com/users/chagmgang/gists{/gist_id}", "starred_url": "https://api.github.com/users/chagmgang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chagmgang/subscriptions", "organizations_url": "https://api.github.com/users/chagmgang/orgs", "repos_url": "https://api.github.com/users/chagmgang/repos", "events_url": "https://api.github.com/users/chagmgang/events{/privacy}", "received_events_url": "https://api.github.com/users/chagmgang/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39243/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/39243/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39242
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39242/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39242/comments
https://api.github.com/repos/huggingface/transformers/issues/39242/events
https://github.com/huggingface/transformers/pull/39242
3,207,581,875
PR_kwDOCUB6oc6dr0hZ
39,242
[vlm] fix loading of retrieval VLMs
{ "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-07-07T05:20:44
2025-07-15T15:23:54
2025-07-15T15:23:54
MEMBER
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39242", "html_url": "https://github.com/huggingface/transformers/pull/39242", "diff_url": "https://github.com/huggingface/transformers/pull/39242.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39242.patch", "merged_at": "2025-07-15T15:23:54" }
# What does this PR do? As per title, reported internally that slow tests are failing. We need to apply same changes as in VLMs to the models that use VLMs in their architecture
{ "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/39242/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/39242/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39241
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39241/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39241/comments
https://api.github.com/repos/huggingface/transformers/issues/39241/events
https://github.com/huggingface/transformers/issues/39241
3,207,216,335
I_kwDOCUB6oc6_KjzP
39,241
[Trainer] Eval loss depends on batch size (with solution)
{ "login": "ba144220", "id": 62748666, "node_id": "MDQ6VXNlcjYyNzQ4NjY2", "avatar_url": "https://avatars.githubusercontent.com/u/62748666?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ba144220", "html_url": "https://github.com/ba144220", "followers_url": "https://api.github.com/users/ba144220/followers", "following_url": "https://api.github.com/users/ba144220/following{/other_user}", "gists_url": "https://api.github.com/users/ba144220/gists{/gist_id}", "starred_url": "https://api.github.com/users/ba144220/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ba144220/subscriptions", "organizations_url": "https://api.github.com/users/ba144220/orgs", "repos_url": "https://api.github.com/users/ba144220/repos", "events_url": "https://api.github.com/users/ba144220/events{/privacy}", "received_events_url": "https://api.github.com/users/ba144220/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-07-07T00:42:36
2025-08-18T08:03:20
2025-08-18T08:03:20
NONE
null
null
null
null
### System Info - `transformers` version: 4.54.0.dev0 - Platform: Linux-5.15.0-1047-oracle-x86_64-with-glibc2.35 - Python version: 3.12.11 - Huggingface_hub version: 0.33.1 - Safetensors version: 0.5.3 - Accelerate version: 1.8.1 - Accelerate config: not found - DeepSpeed version: 0.17.1 - PyTorch version (accelerator?): 2.7.1+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? @SunMarc @ArthurZucker ### Information - [x] The official example scripts - [ ] My own modified scripts ### Tasks - [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [x] My own task or dataset (give details below) ### Reproduction > This is actually a known issue for several years, see: https://discuss.huggingface.co/t/batch-size-during-training-vs-batch-size-during-evaluation/20827 and https://discuss.huggingface.co/t/evaluation-loss-depends-on-batch-size/112046 I’ve been evaluating a few causal LMs (e.g. `Qwen/Qwen2.5-3B`) on 512 samples from the `togethercomputer/RedPajama-Data-1T-Sample` pre-train dataset, and I noticed that **eval loss consistently decreases as I increase the batch size**: Batch size | Eval loss -- | -- 1 | 2.414 2 | 2.340 4 | 2.299 8 | 2.298 16 | 2.296 I saw the same trend across other models as well. This is the code I’m using: ```python import argparse import os import torch from dotenv import load_dotenv load_dotenv() from transformers import AutoModelForCausalLM, AutoTokenizer from trl.trl import SFTConfig, SFTTrainer from datasets import load_dataset def main(): parser = argparse.ArgumentParser() parser.add_argument("--model_name", type=str, default="Qwen/Qwen2.5-3B") parser.add_argument("--dataset_name", type=str, default="togethercomputer/RedPajama-Data-1T-Sample") parser.add_argument("--batch_size", type=int, default=1) parser.add_argument("--max_seq_length", type=int, default=2048) parser.add_argument("--max_eval_samples", type=int, default=512) parser.add_argument("--seed", type=int, default=42) args = parser.parse_args() model = AutoModelForCausalLM.from_pretrained(args.model_name, trust_remote_code=True, device_map="auto", token=os.getenv("HF_TOKEN"), torch_dtype=torch.bfloat16) tokenizer = AutoTokenizer.from_pretrained(args.model_name, trust_remote_code=True, token=os.getenv("HF_TOKEN")) # Load dataset dataset = load_dataset(args.dataset_name, split="train") dataset = dataset.shuffle(args.seed).select(range(args.max_eval_samples)) sft_config = SFTConfig( output_dir="./results", per_device_train_batch_size=args.batch_size, per_device_eval_batch_size=args.batch_size, dataset_text_field="text", max_seq_length=args.max_seq_length, ) trainer = SFTTrainer( model=model, args=sft_config, train_dataset=dataset, eval_dataset=dataset, processing_class=tokenizer, ) eval_result = trainer.evaluate() print(eval_result) if __name__ == "__main__": main() ``` ### Solution Digging in, I found that `fixed_cross_entropy` (in `transformers/src/transformers/loss/loss_utils.py`) does a token-level sum then divides by the total non-padding token count (micro-averaging). To fix the issue, I implemented a **sample-wise average** (macro-averaging): ```python # Hugging Face: token-sum / total_tokens loss = F.cross_entropy(..., reduction="sum") / num_items_in_batch # My version: per-sequence average then mean across sequences loss = F.cross_entropy(..., reduction="none") loss = loss.view(B, -1).sum(dim=1) / token_counts_per_seq loss = loss.mean() ``` With macro-averaging, **eval loss is identical across batch sizes and input orderings**, enabling a few nice benefits: 1. We can choose optimal batch size to speed up evaluation, especially when comparing models of different sizes. 2. Sorting samples by length before batching reduces padding, reducing evaluation time by over **50%**. So I'm wondering: 1. Is the Trainer’s default (micro-averaging) behavior on purposeβ€”to tie loss scale strictly to total token count? 2. Does this have any documented effect on training stability or convergence when you vary batch size? 3. Are there recommended best practices for loss normalization in large-batch LLM training (e.g. should I always override this to macro-average)? I’d love to hear from anyone who’s dug into this or has empirical experience with different loss-averaging schemes in the πŸ€—Trainer. Thanks in advance!
{ "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/39241/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/39241/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/39240
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39240/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39240/comments
https://api.github.com/repos/huggingface/transformers/issues/39240/events
https://github.com/huggingface/transformers/pull/39240
3,206,912,446
PR_kwDOCUB6oc6dpn46
39,240
Improve RoBERTa documentation with explanations and helpful links
{ "login": "PrakyathMC", "id": 92665624, "node_id": "U_kgDOBYX3GA", "avatar_url": "https://avatars.githubusercontent.com/u/92665624?v=4", "gravatar_id": "", "url": "https://api.github.com/users/PrakyathMC", "html_url": "https://github.com/PrakyathMC", "followers_url": "https://api.github.com/users/PrakyathMC/followers", "following_url": "https://api.github.com/users/PrakyathMC/following{/other_user}", "gists_url": "https://api.github.com/users/PrakyathMC/gists{/gist_id}", "starred_url": "https://api.github.com/users/PrakyathMC/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/PrakyathMC/subscriptions", "organizations_url": "https://api.github.com/users/PrakyathMC/orgs", "repos_url": "https://api.github.com/users/PrakyathMC/repos", "events_url": "https://api.github.com/users/PrakyathMC/events{/privacy}", "received_events_url": "https://api.github.com/users/PrakyathMC/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-06T19:37:52
2025-07-07T16:29:05
2025-07-07T16:29:05
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39240", "html_url": "https://github.com/huggingface/transformers/pull/39240", "diff_url": "https://github.com/huggingface/transformers/pull/39240.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39240.patch", "merged_at": null }
## What does this PR do? Improves the RoBERTa model documentation following the standardized format outlined in #36979. ## Changes Made - βœ… Added explanatory comments to Pipeline and AutoModel code examples - βœ… Added "Quick Links" section with popular RoBERTa models on HuggingFace Hub - βœ… Included additional resources (paper links, model collection) - βœ… Improved accessibility for beginners learning to use RoBERTa ## Before and After **Before**: Basic code examples without explanations **After**: Commented code that teaches users what each line does + easy access to models #36979
{ "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/39240/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/39240/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39239
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39239/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39239/comments
https://api.github.com/repos/huggingface/transformers/issues/39239/events
https://github.com/huggingface/transformers/pull/39239
3,206,662,595
PR_kwDOCUB6oc6do02F
39,239
Fix missing initializations for models created in 2023
{ "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-07-06T15:14:13
2025-07-28T08:43:59
2025-07-21T12:43:52
CONTRIBUTOR
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39239", "html_url": "https://github.com/huggingface/transformers/pull/39239", "diff_url": "https://github.com/huggingface/transformers/pull/39239.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39239.patch", "merged_at": "2025-07-21T12:43:52" }
# 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 2023. ## 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/39239/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/39239/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39238
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39238/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39238/comments
https://api.github.com/repos/huggingface/transformers/issues/39238/events
https://github.com/huggingface/transformers/pull/39238
3,206,279,866
PR_kwDOCUB6oc6dnnxP
39,238
[dump] support npu fusion patch
{ "login": "zheliuyu", "id": 190869220, "node_id": "U_kgDOC2Bu5A", "avatar_url": "https://avatars.githubusercontent.com/u/190869220?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zheliuyu", "html_url": "https://github.com/zheliuyu", "followers_url": "https://api.github.com/users/zheliuyu/followers", "following_url": "https://api.github.com/users/zheliuyu/following{/other_user}", "gists_url": "https://api.github.com/users/zheliuyu/gists{/gist_id}", "starred_url": "https://api.github.com/users/zheliuyu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zheliuyu/subscriptions", "organizations_url": "https://api.github.com/users/zheliuyu/orgs", "repos_url": "https://api.github.com/users/zheliuyu/repos", "events_url": "https://api.github.com/users/zheliuyu/events{/privacy}", "received_events_url": "https://api.github.com/users/zheliuyu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
closed
false
null
[]
null
[]
2025-07-06T08:11:13
2025-09-17T06:32:04
2025-08-03T01:28:25
CONTRIBUTOR
null
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39238", "html_url": "https://github.com/huggingface/transformers/pull/39238", "diff_url": "https://github.com/huggingface/transformers/pull/39238.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39238.patch", "merged_at": null }
# What does this PR do? An attempt for https://github.com/huggingface/transformers/issues/39105 ## 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. - [ ] 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? WIP
{ "login": "zheliuyu", "id": 190869220, "node_id": "U_kgDOC2Bu5A", "avatar_url": "https://avatars.githubusercontent.com/u/190869220?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zheliuyu", "html_url": "https://github.com/zheliuyu", "followers_url": "https://api.github.com/users/zheliuyu/followers", "following_url": "https://api.github.com/users/zheliuyu/following{/other_user}", "gists_url": "https://api.github.com/users/zheliuyu/gists{/gist_id}", "starred_url": "https://api.github.com/users/zheliuyu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zheliuyu/subscriptions", "organizations_url": "https://api.github.com/users/zheliuyu/orgs", "repos_url": "https://api.github.com/users/zheliuyu/repos", "events_url": "https://api.github.com/users/zheliuyu/events{/privacy}", "received_events_url": "https://api.github.com/users/zheliuyu/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39238/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/39238/timeline
null
null
null
null
true
true
https://api.github.com/repos/huggingface/transformers/issues/39237
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39237/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39237/comments
https://api.github.com/repos/huggingface/transformers/issues/39237/events
https://github.com/huggingface/transformers/issues/39237
3,205,640,608
I_kwDOCUB6oc6_EjGg
39,237
disable_grouping parameter missed in image_processing_glm4v_fast.py
{ "login": "r0mar0ma", "id": 76665418, "node_id": "MDQ6VXNlcjc2NjY1NDE4", "avatar_url": "https://avatars.githubusercontent.com/u/76665418?v=4", "gravatar_id": "", "url": "https://api.github.com/users/r0mar0ma", "html_url": "https://github.com/r0mar0ma", "followers_url": "https://api.github.com/users/r0mar0ma/followers", "following_url": "https://api.github.com/users/r0mar0ma/following{/other_user}", "gists_url": "https://api.github.com/users/r0mar0ma/gists{/gist_id}", "starred_url": "https://api.github.com/users/r0mar0ma/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/r0mar0ma/subscriptions", "organizations_url": "https://api.github.com/users/r0mar0ma/orgs", "repos_url": "https://api.github.com/users/r0mar0ma/repos", "events_url": "https://api.github.com/users/r0mar0ma/events{/privacy}", "received_events_url": "https://api.github.com/users/r0mar0ma/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-07-05T21:21:59
2025-07-07T09:42:53
2025-07-07T09:42:53
NONE
null
null
null
null
### System Info transformers 4.53.1 ### 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 AutoProcessor.from_pretrained(path, **use_fast = True**) in models/glm4v/image_processing_glm4v_fast.py ``` # Group images by size for batched resizing grouped_images, grouped_images_index = group_images_by_shape(images) ``` while group_images_by_shape has required positional argument 'disable_grouping' ``` def group_images_by_shape( images: Union[list["torch.Tensor"], "torch.Tensor"], disable_grouping: bool, is_nested: bool = False, ) -> tuple[ ``` ### Expected behavior disable_grouping parameter should be added
{ "login": "r0mar0ma", "id": 76665418, "node_id": "MDQ6VXNlcjc2NjY1NDE4", "avatar_url": "https://avatars.githubusercontent.com/u/76665418?v=4", "gravatar_id": "", "url": "https://api.github.com/users/r0mar0ma", "html_url": "https://github.com/r0mar0ma", "followers_url": "https://api.github.com/users/r0mar0ma/followers", "following_url": "https://api.github.com/users/r0mar0ma/following{/other_user}", "gists_url": "https://api.github.com/users/r0mar0ma/gists{/gist_id}", "starred_url": "https://api.github.com/users/r0mar0ma/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/r0mar0ma/subscriptions", "organizations_url": "https://api.github.com/users/r0mar0ma/orgs", "repos_url": "https://api.github.com/users/r0mar0ma/repos", "events_url": "https://api.github.com/users/r0mar0ma/events{/privacy}", "received_events_url": "https://api.github.com/users/r0mar0ma/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/39237/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/39237/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/39236
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/39236/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/39236/comments
https://api.github.com/repos/huggingface/transformers/issues/39236/events
https://github.com/huggingface/transformers/pull/39236
3,205,328,822
PR_kwDOCUB6oc6dkndH
39,236
added moment_p sampling
{ "login": "Hellisotherpeople", "id": 12686966, "node_id": "MDQ6VXNlcjEyNjg2OTY2", "avatar_url": "https://avatars.githubusercontent.com/u/12686966?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Hellisotherpeople", "html_url": "https://github.com/Hellisotherpeople", "followers_url": "https://api.github.com/users/Hellisotherpeople/followers", "following_url": "https://api.github.com/users/Hellisotherpeople/following{/other_user}", "gists_url": "https://api.github.com/users/Hellisotherpeople/gists{/gist_id}", "starred_url": "https://api.github.com/users/Hellisotherpeople/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Hellisotherpeople/subscriptions", "organizations_url": "https://api.github.com/users/Hellisotherpeople/orgs", "repos_url": "https://api.github.com/users/Hellisotherpeople/repos", "events_url": "https://api.github.com/users/Hellisotherpeople/events{/privacy}", "received_events_url": "https://api.github.com/users/Hellisotherpeople/received_events", "type": "User", "user_view_type": "public", "site_admin": false }
[]
open
false
null
[]
null
[]
2025-07-05T17:45:07
2025-10-07T14:24:21
null
NONE
null
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/39236", "html_url": "https://github.com/huggingface/transformers/pull/39236", "diff_url": "https://github.com/huggingface/transformers/pull/39236.diff", "patch_url": "https://github.com/huggingface/transformers/pull/39236.patch", "merged_at": null }
# Moment-P Sampling Implementation for Hugging Face Transformers ## Overview This implementation adds a new sampling method called "Moment-P" to the Hugging Face Transformers library. Moment-P is a novel sampling technique that filters tokens based on the moment (sum of probabilities raised to a power) of the probability distribution. It uses the whole probability distribution and enables very high temperature generations with coherence. A paper is incoming. ## What is Moment-P Sampling? Moment-P sampling filters tokens by calculating a threshold based on the moment of the probability distribution. The moment is calculated as: ``` moment = Ξ£(p_i^exponent) ``` Where: - `p_i` is the probability of token i - `exponent` is a configurable parameter (default: 2.0) Tokens are kept until their cumulative moment exceeds `total_moment * alpha`. ### Key Parameters - **moment_p_exponent** (float, default=2.0): The exponent to which probabilities are raised - **moment_p_alpha** (float, default=1.0): Scaling factor for the threshold ### Behavior with Different Exponents - **exponent=1**: Linear moment, truncate all tokens - **exponent=2** (default): Second moment, emphasizes variance-like behavior - **exponent>2**: Higher emphasis on the tail of the distribution, lower truncation values ## Implementation Details The implementation consists of: 1. **MomentPLogitsWarper** class in `logits_process.py` 2. Configuration parameters in `configuration_utils.py` 3. Integration in `utils.py` for the generation pipeline 4. Export in `__init__.py` ## Usage Examples ### Basic Usage ```python from transformers import AutoTokenizer, AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("distilbert/distilgpt2") tokenizer = AutoTokenizer.from_pretrained("distilbert/distilgpt2") inputs = tokenizer("The future of AI is", return_tensors="pt") # Generate with moment_p sampling output = model.generate( **inputs, do_sample=True, moment_p_exponent=2.0, moment_p_alpha=1.0, max_new_tokens=50 ) print(tokenizer.decode(output[0], skip_special_tokens=True)) ``` ### Advanced Usage with Different Parameters ```python # More selective filtering with lower alpha output = model.generate( **inputs, do_sample=True, moment_p_exponent=2.0, moment_p_alpha=0.5, # More selective max_new_tokens=50 ) # Higher exponent for more tail emphasis output = model.generate( **inputs, do_sample=True, moment_p_exponent=3.0, # Higher moment moment_p_alpha=1.0, max_new_tokens=50 ) ``` ## Mathematical Foundation The moment-based approach allows for flexible control over the token selection process: 1. **Calculate probabilities**: `probs = softmax(logits / temperature)` 2. **Calculate total moment**: `total_moment = Ξ£(probs^exponent)` 3. **Set threshold**: `threshold = total_moment * alpha` ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [X] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. - [X] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation). - [X] Did you write any new necessary tests? ## Who can review? @gante 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/39236/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/39236/timeline
null
null
null
null
true
false