noamaanMulla-03/transformers-issues huggingface dataset:
🌐 [i18n-KO] Translated `model_doc/bert.md` to Korean
Author: boyunJang
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다 -->
# What does this PR do?

Translated the `model_doc/bert.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?
<!-- @harheem, @jeongiin, @1kmmk1, @Seungahson, @win2dvp21 --> 
@junejae, @Jwaminju, @010kim, @4N3MONE, @boyunJang
<!-- @jungnerd, @cjfghk5697, @yijun-lee, @mreraser --> 
<!-- @heuristicwave, @nuatmochoi, @chhaewxn, @jun048098, @ahnjj, @fabxoe -->

## 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:
🌐 [i18n-KO] Translated `model_doc/barthez.md` to Korean
Author: Jwaminju
Pull request: yes

# What does this PR do?

Translated the `model_doc/barthez.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? -->
@junejae, @Jwaminju, @010kim, @4N3MONE, @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?
- [ ] 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?

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

Hello, I'm looking into how to esolve the setup_and_quality failure. Thanks in advance! 

>  Some diff and their modeling code did not match.

Hey, it looks like the `setup_and_quality` test is passing now. The `build_pr_documentation` issue has been resolved on main, so if you wouldn't mind, can you rebase your branch on it to get the fix? 🤗 

Hi, @stevhliu! 
Thanks you so much for your review :) I have rebased the branch!
Best Regards,
Minju
feat: run benchmarks on A100
Author: McPatate
Pull request: yes
Labels: name: Benchmarks

name: run-benchmark

### What does this PR do?

Add A100 runner group for benchmarks CI.

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_34287). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Llama is ExecuTorch compatible
Author: guangy10
Pull request: no
Labels: name: Feature request

name: ExecuTorch

### Feature request

Enable Llama to ["Export to ExecuTorch"](https://github.com/huggingface/transformers/issues/32253) workflow

### Motivation

See details in #32253

### Your contribution

Llama model enablement

Comments:
@guangy10 @amyeroberts 
Hi, I am Debrup Paul, I would like to take up this issue, can this issue be assigned to me? I understood the workflow and will raise the pr in 2 weeks.

Hey! Actually this is already supported and can be closed! 🤗 

> Hey! Actually this is already supported and can be closed! 🤗

Okay, do you have some beginner friendly task on which I can contribute?I actually want to begin contributing in Transformers.I am also a Google Summer of Code Contributor working on NLP and GenAI related problems.
linkedin: https://www.linkedin.com/in/debrup-paul-599158227/

I would recommend you the issues with `Good second issue` or `Good difficult issue` labels! 

> Hey! Actually this is already supported and can be closed! 🤗

Yeah, I had 

> @guangy10 @amyeroberts Hi, I am Debrup Paul, I would like to take up this issue, can this issue be assigned to me? I understood the workflow and will raise the pr in 2 weeks.

Hey @debrupf2946, thanks for reaching out and being interested in llama for ExecuTorch. As @ArthurZucker mentioned, we actually have been working on this model already for a while, so it should just work out-of-the-box. I have a local commit that verify the newly released 1B and 3B model are working e2e. Will publish the PR soon to protect this model with tests. 

Feel free to try a different model that you are interested in. Currently we have a list of candidates linked to the umbrella task #32253.
Gemma is ExecuTorch compatible
Author: guangy10
Pull request: no
Labels: name: Feature request

name: Deployment

### Feature request

### Feature request

Enable Gemma to ["Export to ExecuTorch"](https://github.com/huggingface/transformers/issues/32253) workflow

### Motivation

See details in #32253

### Your contribution

Gemma model enablement

Comments:
lr inconsistency
Author: muhd360
Pull request: yes
Labels: name: HACKTOBERFEST-ACCEPTED

# What does this PR do?


Fixes  #28124 




Comments:
hi @muellerzr Its failing a few tests,
![image](https://github.com/user-attachments/assets/ba613703-0e36-4eec-b381-c42ce39acb5d)
is this in relation with build issues

The right fix should be something like mueller proposed here: 
https://github.com/huggingface/transformers/pull/30169/files

Would you like to try finishing his PR ? 

yes for sure,thx for the refrence im on it

hi @SunMarc the test is failing for the same reason visible here 
![image](https://github.com/user-attachments/assets/8c29d774-5235-4217-8e1d-a0e146886ca4)
added a refrence of other test.How can i deal with this???

@muellerzr pls check it out

Hey @muhd360, can you just verify that mueller PR's gives us the expected results ? His PR should contain the right modifications. 

hi @SunMarc ive used his pr as a point of refrence but still running into this issue should i ask him for help regarding the same???


> hi @SunMarc ive used his pr as a point of refrence but still running into this issue should i ask him for help regarding the same???

which issue ? that the lr reported is not the correct one ? 

Yes this one https://github.com/huggingface/transformers/pull/30169/files

Could you share the metrics ? 

@SunMarc sorry can u pls elaborate????

@muellerzr can u pls help

hi @muellerzr @SunMarc any help????
Generation: fix test
Author: zucchini-nlp
Pull request: yes

# What does this PR do?

Fixes one part of the test that was not being triggered when we run it with `pytest` because it had typo in `cache_position(S)`. Fixing the typo resulted in a whole bunch of errors most of which are caused by apparently non-deterministic output when setting the `repetition_penalty`. Thus I moved the test for beam-search + input-embeds to another place

The main idea when writing this test was to make sure beam search works with inputs embeds for decoder-only models that now support new cache format, so I think the change should be fine


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

# What does this PR do?

Fixes CI which is currently red on many PRs. Caused by https://github.com/huggingface/transformers/pull/34043 and https://github.com/huggingface/transformers/pull/34026 when not all tests were fetched for run 

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

btw I can't merge this while other tests are failing, retriggering didn't help

I think the model used for testing is too large, which casued the timeout error. I proposed a new PR: https://github.com/huggingface/transformers/pull/34482 trying to fixed it by using a small model instead.
Fix PixtralProcessor to return outputs for all examples in a batch
Author: Ryukijano
Pull request: yes

Fixes #34204

Update `PixtralProcessor` to handle batches of images and text prompts correctly.

* Modify the `__call__` method in `src/transformers/models/pixtral/processing_pixtral.py` to process each example in a batch individually.
* Update the handling of images to correctly iterate over the zip of images, image sizes, and text.
* Add a test case in `tests/models/pixtral/test_processor_pixtral.py` to verify the `PixtralProcessor` returns the outputs corresponding to all prompts and images in a batch.
* Ensure the test case includes multiple images and text prompts in a batch and verifies the outputs match the expected outputs for all examples in the batch.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/huggingface/transformers/issues/34204?shareId=09fc5267-4419-410b-ad6f-87d460569bf7).

Comments:
@molbap feel free to take this over, we need a fix for this!
AttributeError: 'SuperPointImageProcessor' object has no attribute 'post_process_keypoint_detection'
Author: darkstar1227
Pull request: no

Hi, I am trying the Keypoint detection but it shows that the `post_process_keypoint_detection` is not an attribute of `SuperPointImageProcessor`.
Here is the link of page.
https://huggingface.co/docs/transformers/en/tasks/keypoint_detection

## System info
- `transformers` version: 4.46.0.dev0
- Platform: Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.25.1
- Safetensors version: 0.4.5
- Accelerate version: 0.34.2
- Accelerate config:    not found
- PyTorch version (GPU?): 2.4.1+cu121 (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 3060 Ti


Comments:
Hi @darkstar1227, thanks for opening an issue! Indeed, I see there is no such method for `SuperPointImageProcessor` in main. That's probably require not yet merged PR
 - https://github.com/huggingface/transformers/pull/33200

 cc @merveenoyan 

Thank you. I will waiting it merge to the main.

You can also try to install from this PR

```
pip install git+https://github.com/huggingface/transformers.git@refs/pull/33200/head
```

> You can also try to install from this PR
> 
> ```
> pip install git+https://github.com/huggingface/transformers.git@refs/pull/33200/head
> ```

Thank you, it is useful. 
I can try keypoint detection now.
Simplify running tests in a subprocess
Author: ydshieh
Pull request: yes

# What does this PR do?

In order to make `running (some individual) tests in a subprocess` work with GPU (cuda), if we use `multiprocessing`, we have to use `spawn`, but this uses pickle and has some limitations that make the necessary changes to the test methods quite big. 

This PR tries to use the `subprocess` module to implement a simpler way to run (some individual) tests in a subprocess.

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

On some docker environment we use, `python` won't work and we have to use `python3`. And in other environments, the situation is inversed. That's why I go for `sys.executable` 👀
Fix typo in classification function selection logic to improve code consistency
Author: moses
Pull request: yes

Fixes https://github.com/huggingface/transformers/issues/32030 
(previously tagged ~#32013~ )

The existing logic has a typo in it, where, for example, it selects a sigmoid classification function if the problem type is "multi_label_classification" or num_labels is 1. The num_labels condition overrides the problem_type condition, so in practice, I don't think this error will cause a bug, but it's confusing.

This fix corrects the problem type conditions.

Please review at your convenience @Narsil 


Comments:
Hi! I think you should be tagging this? https://github.com/huggingface/transformers/issues/32030
Fix ValueError by providing labels in the input
Author: Ryukijano
Pull request: yes

Fixes #34392

Add `labels` argument to compute loss in model inputs.

* **Documentation**: Add a note in `docs/source/en/main_classes/trainer.md` to mention that the `labels` argument must be provided to compute the loss.
* **Train Command**: Ensure that the `labels` argument is included in the input when calling the model in the `run_torch` method in `src/transformers/commands/train.py`.
* **Seq2SeqTrainer**: Ensure that the `labels` argument is included in the input when calling the model in the `prediction_step` method in `src/transformers/trainer_seq2seq.py`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/huggingface/transformers/issues/34392?shareId=60c3084a-d630-4160-8c52-296df088a9a3).

Comments:
Why are these changes affecting copyright? This does not seem to fix the issue that was reported.

> Why are these changes affecting copyright? This does not seem to fix the issue that was reported.

Oh sorry!! That wasn't intentional!!
DataCollatorWithFlattening is incompatible with non - list input ids
Author: alex-hh
Pull request: no
Labels: name: Feature request

name: bug

name: HACKTOBERFEST-ACCEPTED

### System Info

latest transformers

### Who can help?

@ArthurZucker 

### Information

- [ ] The official example scripts
- [x] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [x] My own task or dataset (give details below)

### Reproduction

```python
from transformers import GPT2Tokenizer
tokenizer = GPT2Tokenizer.from_pretrained("openai-community/gpt2")
example = tokenizer("A test sentence", return_tensors="pt")
example = {k: v.flatten() for k, v in tensor_example.items()}
collator([example]*2)
```

### Expected behavior

Collator should work with all output types supported by tokenizer.

Comments:
Hi!
I am planning on working on this under Hacktoberfest 2024. Can you assign me this issue? I hope I am able to solve this


Hey! We do not assign issues, feel free to open a PR 🤗 

@ArthurZucker  , Would you be able to review and merge this request? Thank you.
Change HybridCache.get_seq_length return type to int
Author: TimFelixBeyer
Pull request: yes

# What does this PR do?
Changes `HybridCache.get_seq_length` return type to int to align with other cache classes.

## 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?

@ArthurZucker

Comments:
Fixes for Modular Converter on Windows
Author: hlky
Pull request: yes
Labels: name: HACKTOBERFEST-ACCEPTED

name: Modular

# What does this PR do?

This PR fixes some issues with Modular Converter on Windows.

1. Relative path regex. `rf"(src{os.sep}transformers{os.sep}.*|examples{os.sep}.*)"` results in `(src\transformers\.*|examples\.*)`, due to `\t` and `\.` this regex fails, we replace `\` on `os.path.abspath` instead, and use `(src/transformers/.*|examples/.*)` as the regex.
~~2. Relative path in auto generated message. On Windows this generates as `This file was automatically generated from src\transformers\models\florence2\modular_florence2.py.` This could potentially cause issues elsewhere, and it's better to be standardized, so when `os.sep` == `\` we replace `os.sep` with `/`.~~
3. `open` encoding. On Windows the default encoding is `cp1252` which doesn't work with `🚨`, so we use `encoding=utf-8` instead for all `open`. This particular fix is in effect in many other places in the codebase.

## 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.

@ArthurZucker


Comments:
~~Please note the test failure here is unrelated, looks like `modeling_glm` needs to be overwritten with modular generated code.~~

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

Thanks for your contribution!
Fix regression loading dtype
Author: SunMarc
Pull request: yes

# What does this PR do?
This PR fixes the regression that @BenjaminBossan found out. It was caused by this [PR](https://github.com/huggingface/transformers/pull/33141). Basically, `old_param` was always going to be `None` with the current logic. Hence, we don't set the correct dtype to the parameter `param = param.to(old_param.dtype)`. This caused a dtype mismatch with torchao. 

```
[...]
    return torch.nn.functional.linear(input_tensor, weight_tensor, bias)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: self and mat2 must have the same dtype, but got Float and Half
```

To reproduce
```
import torch
from transformers import AutoModelForCausalLM, TorchAoConfig

quantization_config = TorchAoConfig(quant_type="int8_dynamic_activation_int8_weight")
model_id = "facebook/opt-125m"
model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=quantization_config)
inputs = torch.arange(10).view(-1, 1)
model(inputs)
```

I tested that hqq serialization and the new test that I added both passed 

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_34409). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
FlashAttention2 implementation for OpenELM model
Author: GorkaUrbizu
Pull request: no
Labels: name: New model

### Model description

OpenELM is already available on HF🤗 and transformers, but the model lacks support for flashAttention/FlashAttention2.

I'd love to have the flash attention available for OpenELM in the transformers enviroment. 

thanks in advance.

### Open source status

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

### Provide useful links for the implementation

_No response_

Comments:
Hi @GorkaUrbizu, OpenELM uses custom code, and so we can't actually add support in Transformers! However, I believe it already supports SDPA, which can dispatch to FlashAttention on newer versions of PyTorch.
Fix perplexity computation in perplexity.md
Author: Framartin
Pull request: yes

# What does this PR do?

This pull request fixes an issue in the code of the Perplexity of fixed-length models documentation. The current implementation computes the arithmetic mean of the negative log-likelihood (NLL) per sequence chunk without accounting for the varying number of tokens in each chunk. This can lead to an inaccurate average NLL per token, as tokens in smaller chunks (like the last one) have a higher weight in the final perplexity calculation.  The PR computes the arithmetic mean of NLL per token. The perplexity error is small in the provided example (`16.4541` vs. `16.4443`), but I guess that it can be larger for shorter sequences.


## 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/)? 
- [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  @ArthurZucker




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