noamaanMulla-03/transformers-issues huggingface dataset:
Support AutoAWQ
Author: davidmezzetti
Pull request: no
Labels: name: Feature request

### Feature request

With [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) now being deprecated, would Hugging Face consider continuing support for this library? I've found this library to be the best way to run quantized models with Transformers.

### Motivation

The motivation is being able to continue running quantized models via Transformers. I've found AWQ models to be the best option historically.

### Your contribution

I've seen [this fix](https://github.com/huggingface/transformers/pull/41295) and considered forking the repo to make it myself but it feels like Transformers would be the better place with this given the fairly involved integration. 

Comments:
cc @MekkCyber 

Hi @davidmezzetti, we are indeed continuing the support for loading AutoAWQ models, and we continue to fix issues related to `awq`

Got it, thank you for confirming.

What about [this change](https://github.com/huggingface/transformers/pull/41295/files#diff-d4e7f5649c4bd8c4295717c7b18ae571be46482e278a91c3c9503669c7439da9R55)? It seems like this should be done in a successor package to `autoawq`? 

Have the maintainers considered using GPTQModel instead? https://github.com/ModelCloud/GPTQModel Bit of a misleading name now because it has full AWQ support and is actively maintained along with kernels that optimise performance. I switch out the autoawq automatic loading in transformers with it now and it all runs the same except faster (you need to make some small changes to make peft work with it but these would be easy to support over there too).
Nit parakeet
Author: eustlb
Pull request: yes

# What does this PR do?

Oops, missed that one, but now it burns my eyes 😅

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: parakeet

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_42706). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Fixed failing `BioGPT` batch generation test
Author: Sai-Suraj-27
Pull request: yes

# What does this PR do?
Fixes this failing [BioGPT-batch generation test](https://github.com/huggingface/transformers/actions/runs/19983883282/job/57315087725#step:14:1608)

<img width="1342" height="144" alt="image" src="https://github.com/user-attachments/assets/0f87fb0c-c04a-4652-bfc4-a9b4813caa48" />


## 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?
@gante @Rocketknight1 

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: biogpt

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_42677). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Fix failing `ColPaliModelIntegrationTest`
Author: Sai-Suraj-27
Pull request: yes

# What does this PR do?

Fixes [failing ColPaliModelIntegrationTest](https://github.com/huggingface/transformers/actions/runs/19983883282/job/57315087765#step:14:3489)

<img width="1303" height="61" alt="image" src="https://github.com/user-attachments/assets/df793af1-e5ea-4a6b-96fb-971626c762e0" />


## 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?
@zucchini-nlp @Rocketknight1 

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: colpali

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_42705). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Fixed failing Bart-Model Integration Tests
Author: Sai-Suraj-27
Pull request: yes

# What does this PR do?

Fixes these failing [Bart-Model Integration Tests](https://github.com/huggingface/transformers/actions/runs/19983883282/job/57315087703#step:14:3737). As mentioned in the [V5 Migration guide](https://github.com/huggingface/transformers/blob/main/MIGRATION_GUIDE_V5.md#3-unified-encoding-api): The `encode_plus` method is deprecated in favor of the single `__call__` method.

<img width="1294" height="145" alt="image" src="https://github.com/user-attachments/assets/fde4f7a7-1a0b-4122-a93f-ebe58e3f212e" />



## 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 @Rocketknight1

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: bart

run-slow: bart

This comment contains `run-slow`, running the specified jobs: 

models: ["models/bart"]
quantizations: []

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_42676). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/20034379384)

✅ No failing test specific to this PR 🎉 !
Fixed failing batch_generation test for `opt` model
Author: Sai-Suraj-27
Pull request: yes

# What does this PR do?
Fixes this [failing Batch generation test](https://github.com/huggingface/transformers/actions/runs/19983883282/job/57315088136#step:14:1513) for OPT model.

<img width="1314" height="85" alt="image" src="https://github.com/user-attachments/assets/ed69817d-0bb9-4018-917f-652968e3cd47" />


## 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?
@gante @Rocketknight1 

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: opt

run-slow: opt

This comment contains `run-slow`, running the specified jobs: 

models: ["models/opt"]
quantizations: []

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_42693). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/20034673925)

✅ No failing test specific to this PR 🎉 !
hotfix for circleci summary workflow
Author: ydshieh
Pull request: yes

# What does this PR do?

Many PRs don't have the latest main yet, let's do not fail the workflow file for now.

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_42708). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
add special tokens should probably be serialized and deserialized? 
Author: ArthurZucker
Pull request: yes

# What does this PR do?
This is a bit annoying because we have a function that is called `add_special_tokens`, will deprecate it as well 

fixes #36032, and more

- [ ] just needs a small test!

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_36070). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Fix `tokenization` fallback
Author: ArthurZucker
Pull request: yes

# What does this PR do?
Better fallback / error handling also some BC:
```python
In [1]: from transformers.tokenization_utils import *
/Users/arthurzucker/Work/.venv/lib/python3.13/site-packages/torch/cuda/__init__.py:63: FutureWarning: The pynvml package is deprecated. Please install nvidia-ml-py instead. If you did not install pynvml directly, please report this to the maintainers of the package that installed pynvml for you.
  import pynvml  # type: ignore[import]

In [2]: 

In [2]: from transformers.tokenization_utils import PreTrainedTokenizer

In [3]: PreTrainedTokenizer
Out[3]: transformers.tokenization_python.PythonBackend
```

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_42514). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

**[For maintainers]** Suggested jobs to run (before merge)

run-slow: auto
Added doctests for SwiftFormer model
Author: ankitmalakar7
Pull request: yes

# What does this PR do?

This PR adds documentation tests for `SwiftFormerModel` and `SwiftFormerForImageClassification` as part of the Doc Tests Sprint (#16292).

The doctests include examples for:
- `SwiftFormerModel.forward()` - Showing how to get hidden states
- `SwiftFormerForImageClassification.forward()` - Showing image classification

Fixes #16292 (SwiftFormerModel & SwiftFormerForImageClassification)


## Before submitting
- [x] This PR fixes a typo or improves the docs.
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case.
- [x] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

@yonigozlan @molbap @NielsRogge 

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: swiftformer

@Rocketknight1 can you please review it?
Bug in processing of self.args.parallelism_config inside Trainer
Author: quic-meetkuma
Pull request: no
Labels: name: bug

### System Info

`transformers` version: 5.0.0.dev0 (Added backend specific code only)
Platform: Linux-6.8.0-41-generic-x86_64-with-glibc2.39
Python version: 3.10.19
Huggingface_hub version: 1.0.0.rc6
Safetensors version: 0.6.2
Accelerate version: 1.10.1
Accelerate config: not found
DeepSpeed version: not installed
PyTorch version (accelerator?): 2.7.0+cpu (NA)
Using distributed or parallel set-up in script?: Not needed

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

No steps needed. It is a visible bug.

### Expected behavior

When using accelerate>=1.10.1 with Trainer, the parallelism_config object inside self.args.parallelism_config is being overwritten during TP-only training. This behavior is incorrect because any user-provided values should take precedence and remain unchanged if they are explicitly set.

Reference: https://github.com/huggingface/transformers/blob/fccb04998af44166524c2a7cfe0d946b99aef497/src/transformers/trainer.py#L5091

Comments:
cc @SunMarc (there's a PR at #42671 but it looks like pure code agent output, so I closed it)

Indeed, thanks for the report @quic-meetkuma. This should fix it https://github.com/huggingface/transformers/pull/42704
Raise error when missing or incorrect dates
Author: yonigozlan
Pull request: yes

# What does this PR do?

Running `utils/add_dates.py` in `repo-consistency` check doesn't raise errors, so missing dates are not correctly signaled. This PR checks all model cards and raise an error if any of them is missing a date string (very fast). Also checks if some transformers release dates are wrong (much slower, but only checks models included in the git diff in `repo-consistency`). Note that the command in `repo-consistency` only check for problems and explicitly tells contributors what command to run to fix the issues, but doesn't fix the model cards automatically.

The PR also adds a command in fix-copies to fix the errors on model cards included in the git diff.

Hopefully with that, we'll always have correct transformers release dates, and no model will be released without a transformers release date in its model card.

As a reminder, these dates are used in [this space](https://huggingface.co/spaces/yonigozlan/Transformers-Timeline), which is included in [the docs](https://huggingface.co/docs/transformers/models_timeline), so it would be nice to keep it accurate and up-to-date.

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_42610). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
`OneFormerProcessor` does not support fast image processor
Author: simonreise
Pull request: no
Labels: name: bug

### System Info

transformers 4.57.3
python 3.13.9

### Who can help?

@yonigozlan @molbap

### Information

- [x] The official example scripts
- [x] My own modified scripts

### Tasks

- [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

OneFormer takes both images and text as inputs, so it have image processor and `OneFormerProcessor` which processes both images and text.

Currently initializing `OneFormerProcessor` with an `OneFormerImageProcessorFast` as image processor results in error.


```py
import transformers

processor = transformers.OneFormerImageProcessorFast()
processor = transformers.OneFormerProcessor(
    image_processor=processor,
    tokenizer=transformers.AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32"),
)
```

### Expected behavior

Probably OneFormerProcessor should support OneFormerImageProcessorFast just like it supports slow OneFormerImageProcessor

Probably changing `image_processor_class = "OneFormerImageProcessor"` to `image_processor_class = ("OneFormerImageProcessor", "OneFormerImageProcessorFast")` will be enough

Also probably the logic to keep both image and text inputs on same device could be good to add

Comments:
Hello! I couldn't reproduce the issue, are you sure you're up-to-date with main?

Oh, you are right, it was probably fixed in #41633 and will not happen in v5+. So I close the issue
Add DeepSeek V3.2 model with Lightning Indexer sparse attention
Author: shuyingl
Pull request: yes

## Summary

DeepSeek V3.2 extends DeepSeek V3 with Lightning Indexer for efficient sparse attention. This implementation provides:

- **Lightning Indexer**: Selects top-k tokens per query for sparse attention during inference
- **Multi-head Latent Attention (MLA)**: Inherited from V3 architecture  
- **Mixture of Experts (MoE)**: 256 routed + 1 shared expert
- **Hadamard transform**: For Q/K in indexer (fast-hadamard-transform optional with PyTorch fallback)

### Training API
- `output_indexer_scores=True`: Return raw indexer predictions
- `output_indexer_kl_target=True`: Return KL target distribution  
- `compute_indexer_kl_loss()`: Helper for indexer KL loss computation
- `use_sparse_attention` config: Toggle sparse/dense attention mode

### Key Files
- `src/transformers/models/deepseek_v32/modular_deepseek_v32.py` (source of truth)
- `src/transformers/models/deepseek_v32/modeling_deepseek_v32.py` (auto-generated)
- `tests/models/deepseek_v32/test_modeling_deepseek_v32.py` (unit tests)
- `scripts/modal_verify_deepseek_v32.py` (GPU verification on Modal)
- `docs/DEEPSEEK_V32_API.md` (API reference)
- `docs/DEEPSEEK_V32_HANDOFF.md` (implementation notes)

### Usage
```python
from transformers import DeepseekV32ForCausalLM

model = DeepseekV32ForCausalLM.from_pretrained("deepseek-ai/DeepSeek-V3.2-Exp")
outputs = model(input_ids, output_indexer_scores=True, output_indexer_kl_target=True)
```

## Test plan
- [ ] Unit tests pass (`pytest tests/models/deepseek_v32/`)
- [ ] Modal GPU verification script runs successfully
- [ ] Model loads from pretrained weights
- [ ] Forward pass produces expected outputs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: auto, deepseek_v32
Delete previous comments of `View the CircleCI Test Summary`
Author: ydshieh
Pull request: yes

# What does this PR do?

Delete previous comments of `View the CircleCI Test Summary` so it won't accumulate over multiple pushed commits

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: yolos

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_42725). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

View the CircleCI Test Summary for this PRRRRR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=42725&sha=71c187
Connection to cas-bridge-direct.xethub.hf.co timed out
Author: valentas-kurauskas
Pull request: no

We have today (2025-04-08) started to get this error when running

```python
from transformers import ViTModel
model_name="google/vit-base-patch16-224"
vit = ViTModel.from_pretrained(model_name)
```
from GCP DataFlow workers:

```
Connection to cas-bridge-direct.xethub.hf.co timed out. (connect timeout=10)
```

We generaly do only 20 such downloads per week, sometimes more. Would this be due to us exceeding some rate limits on HF side or due to a recent change in HF and security restrictions on GCP side?

Comments:
Getting same error in
```
RobertaModel.from_pretrained('roberta-base')
```

Hello, getting the same error message.

Do you know why this error does not appear here: [https://status.huggingface.co](https://status.huggingface.co/)? I didn't know if it was just from my side.

Hi, this was a routing error in the Hugging Face infrastructure yesterday! It should be resolved now, so I'm going to close this, but if anyone is still experiencing it please feel free to comment or reopen the issue.

'(ReadTimeoutError("HTTPSConnectionPool(host='cas-bridge.xethub.hf.co', port=443): Read timed out. (read timeout=10)"), '(Request ID: e3131730-f268-4153-aca2-4a7acea7b6e3)')' thrown while requesting GET https://cas-bridge.xethub.hf.co/xet-bridge-us/6826aefff0dd606e13d2ad0b/41c03ed0877aaa72c346cd1f1fabd5d07e7d291a58c778393b2cf03fd185072f?X-Amz。  Maybe I get the problem again


I encountered the same error. After waiting for a while and running the code again, it executed successfully. It may have been a transient issue.

Failed runs:

* https://www.kaggle.com/code/isakatsuyoshi/deepseek-r1-for-clustering-in-text?scriptVersionId=284852179
* https://www.kaggle.com/code/isakatsuyoshi/deepseek-r1-for-clustering-in-text?scriptVersionId=284852598
* https://www.kaggle.com/code/isakatsuyoshi/deepseek-r1-for-clustering-in-text?scriptVersionId=284853387

Successful run:

* https://www.kaggle.com/code/isakatsuyoshi/deepseek-r1-for-clustering-in-text?scriptVersionId=284854791
Fix return_metadata handling in Qwen3VLProcessor & add backend support
Author: yiguanxianyu
Pull request: yes

This PR includes two fixes:

### Fix incorrect return_metadata handling in Qwen3VLProcessor
- Ensures that video metadata is correctly returned when return_metadata=True during processor.apply_chat_template().

### Add backend support to VideosKwargs and improve video backend/device detection

- Add an optional backend parameter in VideosKwargs to allow users to specify the desired video processing backend.
- Fix device detection while reading videos with torchcodec.

Now you can use processor like this:
```python
# Preparation for inference
inputs, metadata = processor.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    return_dict=True,
    return_metadata=True,
    return_tensors="pt",
    videos_kwargs=VideosKwargs(backend="torchcodec", fps=1, torchcodec_device="cuda"),
)
```

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: qwen3_vl

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=42729&sha=f0fccc