noamaanMulla-03/transformers-issues huggingface dataset:
[Regression] Fix Quark quantized model loading after refactorization
Author: BowenBao
Pull request: yes

# What does this PR do?

Similar to #36702, #37136 and #37347. This PR provides a fix for Quark quantized model loading.

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?
@MekkCyber, @SunMarc, @Cyrilvallez 

cc @fxmarty-amd, @amd-xiaoyu12

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

I'm curious when would the quantization tests run in CI? The issue would have been revealed earlier. Maybe the test should include some tiny dummy model that can be validated in each CI? 

run slow: quark_integration

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

models: []
quantizations: ['quantization/quark_integration'] ...

the `require_read_token` is not working for some reason, I made a patch to fix it and add it to all functions here https://github.com/huggingface/transformers/pull/37422

run slow: quark_integration

run slow: quark_integration

run slow: quark_integration

run slow: quark_integration

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

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

models: []
quantizations: ['quantization/quark_integration'] ...

run slow: quark_integration

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

models: []
quantizations: ['quantization/quark_integration'] ...
Fix broken add-fast-image-processor CLI
Author: yonigozlan
Pull request: yes

# What does this PR do?

Following the refactor of the transformers __init__ file and dummy objects, some actions in the add-fast-image-processor CLI are not needed anymore.

Thanks @cjfghk5697 for flagging this in https://github.com/huggingface/transformers/pull/37496

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

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

> LGTM on principle! Did you test it by any chance to make sure that everything (especially the model init) match the new format? 🤗

Yep the model init was alredy up-to-date, so we should be good!
Update VITS model card
Author: princepride
Pull request: yes

# What does this PR do?

This PR updates the VITS model card to follow the new Hugging Face model card format.

- Adds framework and optimization badges
- Updates the checkpoint discovery link to the official [[facebook?search_models=mms-tts](https://huggingface.co/facebook?search_models=mms-tts)](https://huggingface.co/facebook?search_models=mms-tts) collection
- Moves model-specific usage tips (e.g., `uroman`, seed setting) into the `> [!TIP]` section
- Includes `pipeline` and `AutoModel` code examples for easy usage

This improves the usability and discoverability of the VITS model and aligns its documentation with the newer standards used in models like Whisper.

Fixes # (no specific issue, doc enhancement)

---

## Before submitting

- [x] This PR improves the documentation
- [x] I’ve read the [[contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request)](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request)
- [x] Documentation was updated accordingly

## Who can review?

@eustlb (for speech models)  
@stevhliu (for documentation)

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

@stevhliu Thank you for your suggestion. I've made the changes—please review it again 😊

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

@stevhliu Sorry, I have add the Note content, can you review it again  😊

@stevhliu Hi, can you review the update again? 😊
Refactor ColPali model documentation
Author: Soum-Soum
Pull request: yes

# What does this PR do?

As suggested in this issue - #36979 - this PR updates the documentation of the ColPali model, which will now be aligned with the standardized format for all the docs.

## Who can review?

@stevhliu, please let me know if any changes are needed.

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

@stevhliu I've made a pass on your feedback. Let me know if you see some new things to change/improve.


The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_37309). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
fix and enhance pipeline_webserver.md
Author: yao-matrix
Pull request: yes

There are 2 issues when a developer follow pipeline_webserver.md to start the journey of web service, he/she will meet 2 issues:
**1) when run the naive server, there will be error**

> Task exception was never retrieved future: <Task finished name='Task-3' coro=<server_loop() done, defined at /workspace/server.py:15> exception=UnboundLocalError("local variable 'pipeline' referenced before assignment")> Traceback (most recent call last): File "/workspace/server.py", line 16, in server_loop pipeline = pipeline(task="fill-mask", model="google-bert/bert-base-uncased") UnboundLocalError: local variable 'pipeline' referenced before assignment

cause is the code using `pipeline` both for module name and as variable.

**2)  when try enhanced version, it's confusing for a new bee like me and the code snippet is buggy.**

this PRs fixed these 2 issues.


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

cc @stevhliu and @Narsil who wrote the original doc I believe!

@stevhliu and @Narsil, could you take a look? thx

ci issue seems from ci system

@Narsil , Nicolas, could you help take a look? Thx very much.

@stevhliu , hi, is there a way to let Nicolas know and help take a look at it? thx

@stevhliu , since we already get Nicolas's approval, could you help merge it? Thx.

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_36992). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Why is wandb being logged in and how to turn it off?
Author: Kiera-K
Pull request: no

I do not have a profile with wandb profile. I have not logged into anything and I don't want to use wandb. I am simply following this notebook to finetune a T5 model for summarization https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/summarization.ipynb#scrollTo=X4cRE8IbIrIV (I am not running the huggingface login and the git cells)
The notebook was working fine till a day before and I was storing checkpoints but now when I try to run either from the checkpoint or by loading t5-small, I get asked for the wandb API key on running the trainer. I don't even have a profile. 
<img width="1013" alt="Screen Shot 2022-04-04 at 7 19 45 PM" src="https://user-images.githubusercontent.com/78582210/161647987-eeb3066e-72d9-4cad-9a7e-e2810073984f.png">

When I tried wandb off, it again asked me for the API key.
I tried os.environ["WANDB_DISABLED"]  = "true" but it doesn't work. 
trainer.train() runs for 501 iterations and then gives the following error : 
<img width="754" alt="Screen Shot 2022-04-04 at 7 04 49 PM" src="https://user-images.githubusercontent.com/78582210/161646555-26741d97-5c0e-44c5-9461-8dd93a35ab99.png">

I don't understand why it suddenly started asking me for this and how to resolve it. 
Please help

@sgugger 

Comments:
hey @Nikita-Salkar I work at Weights & Biases, you can turn off all external logger logging, including wandb logging by passing  `report_to="none"` in your `Seq2SeqTrainingArguments`.

You might have noticed the following warning when setting up your TrainingArguments.

```
The default value for the training argument `--report_to` will change in v5 (from all installed integrations to none). In v5, you will need to use `--report_to all` to get the same behavior as now. You should start updating your code and make this info disappear :-)
```

Right now the default is to run all loggers that you have installed, so maybe you installed wandb on your machine since the last time you ran the script?

If you would like to log with wandb, best practice would already be to start setting `report_to="wandb"`

Hello @morganmcg1 !! Thank you so very much! That worked! My first error says "Automatic weights & biases logging enabled..." so I guess it automatically logs me in because I did not install wandb. Grateful for your help! Thank you!

@Nikita-Salkar glad it worked :) We can probably close this issue right?

@morganmcg1 Yes yes. Thank you!

I hate wandb, Why on earth do you think defaulting every training logs to wandb is a good idea?
BLIP-2 float16 example does not work
Author: nhatkhtn
Pull request: no
Labels: name: bug

### System Info

- `transformers` version: 4.50.0
- Platform: Linux-4.18.0-553.40.1.el8_10.x86_64-x86_64-with-glibc2.28
- Python version: 3.12.8
- Huggingface_hub version: 0.28.0
- Safetensors version: 0.5.2
- Accelerate version: 1.5.2
- Accelerate config:    not found
- DeepSpeed version: not installed
- PyTorch version (GPU?): 2.5.1 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: No
- Using GPU in script?: Yes
- GPU type: NVIDIA A100-SXM4-80GB

### 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

The following code, taken from [the official documentation](https://huggingface.co/docs/transformers/main/en/model_doc/blip-2#transformers.Blip2Model), does not work.

```python
from PIL import Image
import requests
from transformers import Blip2Processor, Blip2Model
import torch

device = "cuda" if torch.cuda.is_available() else "cpu"

processor = Blip2Processor.from_pretrained("Salesforce/blip2-opt-2.7b")
model = Blip2Model.from_pretrained("Salesforce/blip2-opt-2.7b", torch_dtype=torch.float16)
model.to(device)
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

prompt = "Question: how many cats are there? Answer:"
inputs = processor(images=image, text=prompt, return_tensors="pt").to(device, torch.float16)

outputs = model(**inputs)
```

Running the above code gives the error
```python
RuntimeError: expected scalar type Float but found Half
```

### Expected behavior

There should be no errors.

Comments:
It was fixed by https://github.com/huggingface/transformers/pull/37068, we'll do a patch release for that :)

Patch is out: https://github.com/huggingface/transformers/releases/tag/v4.50.3

Hi, I don't know if it is appropriate to mention this here. I really wanted to test the patch, but the conda packages of transformers 4.50.1 and above is currently bugged. They cannot be downloaded, as seen [here](https://anaconda.org/conda-forge/transformers/files). Since my environment is conda-based, I cannot try the pip version.

Hi, I tested with transformers 4.51.3 and the issue is fixed. This issue can be closed. Kudos to the developers!
In "02_how_to_generate", code cell 1 has an error message
Author: kvutien
Pull request: no
Labels: name: bug

### System Info

In "02_how_to_generate", code cell 1 has an error message but the rest works fine: ERROR: Could not find a version that satisfies the requirement tensorflow==2.1 (from versions: 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.12.1, 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.0, 2.13.1, 2.14.0rc0, 2.14.0rc1, 2.14.0, 2.14.1, 2.15.0rc0, 2.15.0rc1, 2.15.0, 2.15.0.post1, 2.15.1, 2.16.0rc0, 2.16.1, 2.16.2, 2.17.0rc0, 2.17.0rc1, 2.17.0, 2.17.1, 2.18.0rc0, 2.18.0rc1, 2.18.0rc2, 2.18.0, 2.19.0rc0) ERROR: No matching distribution found for tensorflow==2.1.

### Who can help?

_No response_

### Information

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

### Tasks

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

### Reproduction

Run code cell 1

### Expected behavior

No error message should appear when running code cell

Comments:
"The issue seems to be in the huggingface/blog repository, not this one.
The file 02_how_to_generate.ipynb is present there.
The error occurs because TensorFlow 2.1 is outdated and no longer available.
A possible fix is to update tensorflow==2.1 to tensorflow>=2.12 or the latest version.

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.
Keep Quark loading through meta device
Author: BowenBao
Pull request: yes

# What does this PR do?

Follow-up to #37407 to revert part of fix that is unnecessary for quark. [Discussions](https://github.com/huggingface/transformers/pull/37407#discussion_r2044530489)

## 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.

 @SunMarc @MekkCyber @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 and @SunMarc
- chat templates: @Rocketknight1

Integrations:

- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber

Documentation: @stevhliu

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->


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

run slow: quark_integration

Thanks for reverting @BowenBao! We try to keep everything as simple as possible! 🤗
Add support for TimesFM
Author: geetu040
Pull request: no
Labels: name: New model

name: Time Series

### Model description

**TimesFM** (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.

### Open source status

- [X] The model implementation is available
- [X] The model weights are available

### Provide useful links for the implementation

- Research Paper: https://arxiv.org/abs/2310.10688

- Authors: [Abhimanyu Das](https://arxiv.org/search/cs?searchtype=author&query=Das,+A), [Weihao Kong](https://arxiv.org/search/cs?searchtype=author&query=Kong,+W), [Rajat Sen](https://arxiv.org/search/cs?searchtype=author&query=Sen,+R), [Yichen Zhou](https://arxiv.org/search/cs?searchtype=author&query=Zhou,+Y)

- Implementation: [google-research/timesfm](https://github.com/google-research/timesfm)
  - The linked repository contains code for implementation in `jax` as well `pytorch`. To implement this in `huggingface` the `pytorch` specific code can be found at [src/timesfm/pytorch_patched_decoder.py](https://github.com/google-research/timesfm/blob/master/src/timesfm/pytorch_patched_decoder.py)

- Models Weights: [google/timesfm-1.0-200m-pytorch](https://huggingface.co/google/timesfm-1.0-200m-pytorch)
  - Although there are weights given in the repository, yet there are missing config files that are to be completed to ensure smooth loading of weights.

Comments:
If approved, I would be happy to contribute to this

Let's see if there is interest! If any lurkers are interested, please react to the original post or comment here to mention your interest :) thank you!

I'm interested to work on this!

Just found this PR: https://github.com/huggingface/transformers/pull/34082
being worked by @jinan-zhou, @kashif and @rajatsen91
Add TimesFM Time Series Forecasting Model
Author: jinan-zhou
Pull request: yes
Labels: name: New model

# What does this PR do?

Fixes #33745


This PR adds a new model, TimesFM, to HuggingFace. TimesFM is a time series forecasting model based on the transformer architecture. It was proposed in [A decoder-only foundation model for time-series forecasting](https://arxiv.org/html/2310.10688v2). 

## Code Example
```
import numpy as np
from transformers import TimesFMModel
from transformers import TimesFMConfig

config = TimesFMConfig()
model = TimesFMModel(config)

forecast_input = [
    np.sin(np.linspace(0, 20, 100)),
    np.sin(np.linspace(0, 20, 200)),
    np.sin(np.linspace(0, 20, 400)),
]
frequency_input = [0, 1, 2]

results = model(
    inputs=forecast_input,
    freq=frequency_input,
)
```


# TODOs
1. Unit Tests
2. Documentations and doc strings
3. Pretrained weights 
4. ONNX definition
5. Model parallelism 

<!-- 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: @ylacombe, @eustlb
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @muellerzr and @SunMarc
- chat templates: @Rocketknight1

Integrations:

- deepspeed: HF Trainer/Accelerate: @muellerzr
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc

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: @sanchit-gandhi
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->


Comments:
Great work! I left some minor comments.

Would this PR add finetuning support for the model?

Marking @kashif as the HF point of contact for this!

cc @Cyrilvallez for a review!

cc @Cyrilvallez and authors feel free to ping me once this is ready for final review!

Hey! Feel free to ping me once you feel you're ready for a new review! 🤗

thanks, @Cyrilvallez so just fixing the rest of the stuff... i think this method has no `generate` method as the forward naturally returns the next prediction_length forecast in all cases... 

Since `PreTrainedModel` is still a subclass of `GenerationMixin`, if it does not need a `generate`, you can simply overwrite it and return a useful exception explaining how to use the model instead 👌

@Cyrilvallez all done and note 1 comment
Update quantization docs
Author: DerekLiu35
Pull request: yes

Created draft of quantization concept guide

@SunMarc 

Comments:
The Build PR documentation CI is not passing @DerekLiu35, can you fix it ? 

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