noamaanMulla-03/transformers-issues huggingface dataset:
🌐 [i18n-KO] Translated output.md to Korean
Author: 4N3MONE
Pull request: yes

# What does this PR do?

Translated the `<your_file>.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)

@junejae, @Jwaminju, @010kim, @boyunJang 


## 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?
- [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? (Final)
May you please review this PR? @stevhliu.

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_33607). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
🌐 [i18n-KO] Translated `image_processing_utils.md` to Korean
Author: yijun-lee
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다 -->
# What does this PR do?

Translated the `image_processing_utils.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)

<!-- 1. 위 체크가 모두 완료된 뒤에만 N조 팀원들에게 리뷰 요청하는 아래 주석을 노출해주세요! 차례대로 1 ~ 5조 -->
May you please review this PR?
@jungnerd, @cjfghk5697, @yijun-lee, @mreraser


## 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#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?

## Who can review? (Final)

<!-- 2. N조 팀원들과 리뷰가 끝난 후에 아래 주석을 노출해주세요! -->
@stevhliu May you please review this PR?

Comments:
LGTM 💯 

LGTM🎯

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

I have resolved it! Thank you :) @stevhliu
🌐 [i18n-KO] Translated `modular_transformers.md` to Korean
Author: yijun-lee
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다 -->
# What does this PR do?

Translated the `modular_transformers.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)

<!-- 1. 위 체크가 모두 완료된 뒤에만 N조 팀원들에게 리뷰 요청하는 아래 주석을 노출해주세요! 차례대로 1 ~ 5조 -->
May you please review this PR?
@jungnerd, @cjfghk5697, @yijun-lee, @mreraser


## 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#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?

## Who can review? (Final)

<!-- 2. N조 팀원들과 리뷰가 끝난 후에 아래 주석을 노출해주세요! -->
@stevhliu May you please review this PR?

Comments:
I have resolved it! Thank you :) @stevhliu 

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_33772). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
[`Patch helper`] update to not have to checkout main
Author: ArthurZucker
Pull request: yes

# What does this PR do?
Also adds support for full PR links

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_34006). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Request for Iterative Generation in Pipeline (e.g., LLaMA model)
Author: qsunyuan
Pull request: no
Labels: name: Feature request

### Feature request

I would like to ask if there is a way to perform iterative generation (n times) within the pipeline, specifically for models like LLMs. If this feature is not available, is there any plan to implement it in the future?

Example:
```python
pipeline = transformers.pipeline(
            "text-generation",
            model="meta-llama/Llama-3.1-8B-Instruct",
            model_kwargs={"torch_dtype": torch.bfloat16},
            device_map="auto",
        ) 

# Generate once
outputs = llama_client(
              messages,
              max_new_tokens=max_tokens
          )
# Generate n times
outputs = llama_client(
              messages,
              max_new_tokens=max_tokens,
              n = n
          )
```

Similar GPT API
```python
response = client.chat.completions.create(
            model=model,
            messages=messages, 
            max_tokens=max_tokens,
            temperature=temperature, 
            n=n,  
        )
```

I am also aware that iterative generation can be done using a for loop, but I am wondering if there is a more efficient or optimized way to generate multiple iterations (n times) within the pipeline for models.

https://community.openai.com/t/how-does-n-parameter-work-in-chat-completions/288725


### Motivation

build connection between LLM api and transformer pipeline

### Your contribution

Request

Comments:
Sounds interesting, let's see if this is asked by the community ! We usually check activity here 🚀 
cc @Rocketknight1 

Hmmn, a simple solution would be to replicate the input `n` times:

`output = pipeline([input_chat] * n)`

However, the text generation pipeline will only handle a single input at a time, so it's basically the same as using a for loop. We'd need to refactor the pipeline a lot to make this efficient, although you can do it efficiently with lower-level `generate()` calls I think!

I am so utterly confused right now.
isn't the solution just 
```python
pipeline([inputs],num_return_sequences=n)
```
or am I missing something?
Add Loss Functions for QFormer Training in BLIP-2 Model (ITC, ITM, and ITG)
Author: thisisiron
Pull request: no
Labels: name: Feature request

name: Multimodal

### Feature request

I propose adding a loss calculation for QFormer training in the BLIP-2 model. Implementing this feature would allow fine-tuning the QFormer and language models for image-text retrieval and captioning tasks, which is crucial for practical applications.

### Motivation

I want to train the BLIP-2 model using the transformers library. In particular, loss functions for Image-Text Contrastive (ITC), Image-Text Matching (ITM), and Image-grounded Text Generation(ITG) are not included, which requires users to manually implement the loss functions.

### Your contribution

I would like to contribute to this open-source project by implementing the loss functions.

Comments:
hey, @thisisiron i would like to work on this.
Generate: remove most decoder-only LLMs `prepare_inputs_for_generation`
Author: gante
Pull request: yes

# What does this PR do?

Part of step 6 in #32685
Follow-up to #33677 

This PR:
1. revises `GenerationMixin.prepare_inputs_for_generation` so as to handle models WITHOUT the `Cache` refactor, prepare `token_type_ids`, and forward arbitrary kwargs
2. because of 1., we can remove this function from most decoder-only LLMs 🧹🤗🧹 All decoder-only LLMs were checked
3. added a comment on each overwrite occurring in decoder-only LLMs, for our future selves 

_________________________________
✅ slow tests were ran on `llama` and `gpt2`

Comments:
Hey! 🤗 Thanks for your contribution to the `transformers` library!

Before merging this pull request, slow tests CI should be triggered. To enable this:
- Add the `run-slow` label to the PR
- When your PR is ready for merge and all reviewers' comments have been addressed, push an empty commit with the command `[run-slow]` followed by a comma separated list of all the models to be tested, i.e. `[run_slow] model_to_test_1, model_to_test_2`
  - If the pull request affects a lot of models, put at most 10 models in the commit message
- A `transformers` maintainer will then approve the workflow to start the tests

(For maintainers) The documentation for slow tests CI on PRs is [here](https://www.notion.so/huggingface2/CI-for-pull-requests-8335bd9217d24d1e8ed1d3a016f39804).

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

before merging, ran locally:
- `py.test tests/models/ -k greedy` -- all PT tests passing
- `RUN_SLOW=1 py.test tests/models/gpt2/test_modeling_gpt2.py` 
- `RUN_SLOW=1 py.test tests/models/llama/test_modeling_llama.py` (there are two failing tests, but they come from `main`)
Mllama: fix tests
Author: zucchini-nlp
Pull request: yes

# What does this PR do?

As per title, fixes skipped tests in mllama and the QuantoQuantizedCache with new optimum-quanto library


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_34000). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
AttributeError: 'SGD' object has no attribute 'train'
Author: SangbumChoi
Pull request: no
Labels: name: trainer

name: bug

name: Vision

### System Info

Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.

- `transformers` version: 4.46.0.dev0
- Platform: Linux-5.15.0-100-generic-x86_64-with-glibc2.35
- Python version: 3.10.14
- Huggingface_hub version: 0.24.7
- Safetensors version: 0.4.5
- Accelerate version: 0.33.0
- Accelerate config:    not found
- PyTorch version (GPU?): 2.2.2 (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 A100 80GB PCIe

- `Accelerate` version: 0.33.0
- Platform: Linux-5.15.0-100-generic-x86_64-with-glibc2.35
- `accelerate` bash location: /opt/conda/bin/accelerate
- Python version: 3.10.14
- Numpy version: 1.26.4
- PyTorch version (GPU?): 2.2.2 (True)
- PyTorch XPU available: False
- PyTorch NPU available: False
- PyTorch MLU available: False
- PyTorch MUSA available: False
- System RAM: 755.86 GB
- GPU type: NVIDIA A100 80GB PCIe
- `Accelerate` default config:
        Not found

### Who can help?

@muellerzr @SunMarc 

### 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_object_decection.py

### Expected behavior

After adding 

```
        if hasattr(self.optimizer, "train") and callable(self.optimizer.train):
            self.optimizer.train()
```

It returns the following error when the input of optimizers is raw pytorch optimizer

```
    optimizer = torch.optim.AdamW(
        parameter,
        lr=cfg.lr,
        weight_decay=cfg.weight_decay,
    )
```


Comments:
Also cc @qubvel regarding object detction

I assume that this error will not be stricted to vision area, but not sure 

https://github.com/SangbumChoi/transformers/blob/e783f12f204ead2906ecd9c8c1196650b4c4adad/src/transformers/trainer.py#L354

potential related issue 
https://github.com/huggingface/accelerate/pull/2631
https://github.com/huggingface/transformers/pull/30079

Hi @SangbumChoi, I also faced this issue with the outdated version of Accelerate, updating it should help!

@qubvel Can you tell me which version should I use? I am using 0.33.0

Could you try with 0.34?

@qubvel Thanks it works :)
Fix PIL dep for tests
Author: muellerzr
Pull request: yes

# What does this PR do?

https://github.com/huggingface/transformers/pull/32385 missed that we need `@require_vision` for the new processor tests. We don't install PIL in the accelerate test suite, which flagged this requirement. 

Fixes # (issue)


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@LysandreJik 

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_34028). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
FEAT : Adding BitNet quantization method to HFQuantizer
Author: MekkCyber
Pull request: yes

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->
This pull request introduces a new quantization method: [BitNet](https://arxiv.org/pdf/2310.11453) quantization at 1.58 bits. It enables users to load and utilize quantized & packed models with ternary weights directly in Transformers, providing out-of-the-box inference.
<!-- Remove if not applicable -->



## Who can review?

@SunMarc 

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @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:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_33410). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Can you have a look @dacorvo on the BitLinear class ? I would love to have your insights !
🌐 [i18n-KO] Translated `model_doc/bart.md` to Korean
Author: fabxoe
Pull request: yes

# What does this PR do?

Translated the `model_doc/bart.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)

<!-- 1. 위 체크가 모두 완료된 뒤에만 N조 팀원들에게 리뷰 요청하는 아래 주석을 노출해주세요! 차례대로 1 ~ 5조 -->
<!-- May you please review this PR? -->
@chhaewxn, @ahnjj, @jun048098, @fabxoe, @nuatmochoi, @heuristicwave

## 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)

<!-- 2. N조 팀원들과 리뷰가 끝난 후에 아래 주석을 노출해주세요! -->
@stevhliu May you please review this PR?

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_33893). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
🌐 [i18n-KO] Translated `model_doc/deberta.md` to Korean
Author: fabxoe
Pull request: yes

# What does this PR do?

Translated the `model_doc/deberta.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)

<!-- 1. 위 체크가 모두 완료된 뒤에만 N조 팀원들에게 리뷰 요청하는 아래 주석을 노출해주세요! 차례대로 1 ~ 5조 -->
<!-- May you please review this PR? -->
@chhaewxn, @ahnjj, @jun048098, @fabxoe, @nuatmochoi, @heuristicwave

## 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)

<!-- 2. N조 팀원들과 리뷰가 끝난 후에 아래 주석을 노출해주세요! -->
@stevhliu May you please review this PR?

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