noamaanMulla-03/transformers-issues huggingface dataset:
🌐 [i18n-KO] Translated `vision-encoder-decoder.md` to Korean
Author: jihyun-0611
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다 -->
# What does this PR do?

Translated the `vision-encoder-decoder.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]]`)
- [x] Check live-preview for gotchas (live-preview로 정상작동 확인)

## Who can review? (Initial)

<!-- 1. 위 체크가 모두 완료된 뒤에만 KREW 팀원들에게 리뷰를 요청하는 아래 주석을 노출해주세요!-->
May you please review this PR?
@4N3MONE, @yijun-lee, @jungnerd , @harheem

## 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. KREW 팀원들의 리뷰가 끝난 후에 아래 주석을 노출해주세요! -->
@stevhliu May you please review this PR?

Comments:
Thanks, would you mind resolving the conflict?
Revert "fix `notification_service.py` about `time_spent`"
Author: ydshieh
Pull request: yes

Reverts huggingface/transformers#40037

There were some edge case errors not detected until a full run was triggered

https://github.com/huggingface/transformers/actions/runs/16833364235/job/47693598035

```
  File "/home/runner/work/transformers/transformers/utils/notification_service.py", line 206, in time
    hours, minutes, seconds = int(time_parts[0]), int(time_parts[1]), float(time_parts[2])
ValueError: invalid literal for int() with base 10: '(0'
```

revert for now to avoid next daily CI failing to produce reports.

Will check and fix later.

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_40044). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Please support loading Qwen 2.5 VL from GGUF
Author: ihendley
Pull request: no
Labels: name: Feature request

### Feature request

The new [Qwen Image](https://huggingface.co/Qwen/Qwen-Image) uses Qwen 2.5 VL 7B as a text encoder. Given memory constraints, some users may want to load a quantized image model and text encoder for a diffusers QwenImagePipeline, for example:

```
from diffusers import QwenImagePipeline, QwenImageTransformer2DModel, GGUFQuantizationConfig
import torch
from transformers import AutoModelForCausalLM


transformer = QwenImageTransformer2DModel.from_single_file(
    "https://huggingface.co/QuantStack/Qwen-Image-GGUF/blob/main/Qwen_Image-Q4_K_M.gguf",
    quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
    torch_dtype=torch.bfloat16,
    config="Qwen/Qwen-Image",
    subfolder="transformer",
)

text_encoder = AutoModelForCausalLM.from_pretrained(
    "unsloth/Qwen2.5-VL-7B-Instruct-GGUF", 
    gguf_file="Qwen2.5-VL-7B-Instruct-Q4_K_M.gguf", 
    torch_dtype=torch.bfloat16, 
)

pipe = QwenImagePipeline.from_pretrained(
    "Qwen/Qwen-Image",
    transformer=transformer,
    text_encoder=text_encoder,
    torch_dtype=torch.bfloat16,
)
```

However, this currently fails with the error:

ValueError: GGUF model with architecture qwen2vl is not supported yet.

### Motivation

As described above, Qwen 2.5 VL 7B is the text encoder for the new state-of-the-art Qwen Image model, and diffusers will either attempt to download and load the full unquanitzed Qwen 2.5 VL 7B (~15GB), or it will accept a transformers model text_encoder argument, so it would be very useful to be able to load a GGUF model here to save memory.

### Your contribution

With some help getting started and support along the way I could make an attempt at a PR. However it might be quicker if someone with more experience takes the lead.

Comments:
Add QLIP Model
Author: lavinal712
Pull request: yes
Labels: name: New model

Fixes # (issue)
https://github.com/huggingface/transformers/issues/37165

## 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?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?


## Who can review?

@amyeroberts, @qubvel

This PR has a few TODO items: 1. Modify the comments. 2. Add documentation. Furthermore, I want to state that I am not the author of QLIP, but I hope to add this model to transformers.


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 @Cyrilvallez as I will be off for 2 weeks! 

@Cyrilvallez

Hey @lavinal712! Thanks for tackling this! You can find more informations about adding a model in general [here](https://huggingface.co/docs/transformers/en/add_new_model), and how to use our new modular tool to do it easily [here](https://huggingface.co/docs/transformers/main/en/modular_transformers). Also, don't hesitate to look past PRs about adding model for examples! Let me know if you have more questions 🤗

Removing the review pings until this is ready for review!

Close this PR because AutoModel can automatically load it.
🌐 [i18n-KO] Updated ko/perf_train_cpu.md
Author: D15M4S
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Updated ko/perf_train_cpu.md" 으로 부탁드립니다 -->
# What does this PR do?

Updated the perf_train_cpu.md file in the documentation with a Korean translation.
Thank you in advance for your review.

Part of https://github.com/huggingface/transformers/issues/20179
Update of #24911

## 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]]`)
- [x] Check live-preview for gotchas (live-preview로 정상작동 확인)

## Who can review? (Initial)

<!-- 1. 위 체크가 모두 완료된 뒤에만 KREW 팀원들에게 리뷰를 요청하는 아래 주석을 노출해주세요!-->
May you please review this PR?
@jungnerd, @luckyvickyricky, @chelsseeey, @skwh54, @amo33, @maximizemaxwell
<!-- @harheem, @nsbg, @Youngdong2, @xhaktm00, @ssunbear, @ChoHyoungSeo, @judy-choi -->
<!-- @4N3MONE, @Kim-Ju-won, @ahnjj, @FacerAin, @ssum21, @TaskerJang, @HyunZ118 -->
<!-- @yijun-lee, @songi104, @chhaewxn, @AhnJoonSung, @jihyun-0611, @seopp, @pyapyapya -->

## 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.
- [ ] 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. KREW 팀원들의 리뷰가 끝난 후에 아래 주석을 노출해주세요! -->
<!-- @stevhliu May you please review this PR? -->



Comments:
Not capable of exporting Mistral to ONNX format with the use of caching
Author: EricJi150
Pull request: no

Hello,

I've been attempting to export the HuggingFace [Mistral](https://huggingface.co/docs/transformers/model_doc/mistral?_sm_vck=fW0WBVNM3T7q2MFfHHmDslJVQjVBV4Vqsf6WkfjSqfR2VH0W6Rf3) model to ONNX format with caching on, but have been unsuccessful. After export, when I go to the config file, the `use_cache` variable is set to True. However, during inference, I still get an error stating that the model does not support caching.

This is the error: 

> ValueError: `use_cache=True` was passed to the model but the loaded model only supports `use_cache=False`. Please load your current model with `use_cache=False` or export the original model once again with `use_cache=True` when calling the `from_pretrained` method. To re-export your model, simply set `export=True` in the `from_pretrained` method.

Here is my code:
```
import time
from optimum.exporters.onnx import main_export, model_configs, onnx_export_from_model
from optimum.onnxruntime import ORTModelForCausalLM
from transformers import LlavaForConditionalGeneration, AutoTokenizer, pipeline, AutoModelForCausalLM

def export(output_path='onnx_language_model'):
    model = AutoModelForCausalLM.from_pretrained('mistralai/Mistral-7B-Instruct-v0.3', trust_remote_code=True)

    custom_onnx_configs = {
        "model": model_configs.MistralOnnxConfig(
            config=model.config,
            task="text-generation",
        )
    }

    onnx_export_from_model(
        model=model,
        task="text-generation",
        output=output_path,
        opset=17,
        custom_onnx_configs=custom_onnx_configs
    )

def predict_onnx(text, model_path='onnx_language_model'):
    model = ORTModelForCausalLM.from_pretrained(model_path, provider='CUDAExecutionProvider')
    tokenizer = AutoTokenizer.from_pretrained('mistralai/Mistral-7B-Instruct-v0.3')
    pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
    result = pipe(text, max_new_tokens=100)
    print(result)
```

Comments:
Can you try `model.config.use_cache = False` ? 

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.
Previous PRs introduced a bug on Accumulated Gradients Losses
Author: w32zhong
Pull request: no
Labels: name: bug

### System Info

- `transformers` version: 4.54.1
- Platform: Linux-5.15.0-131-generic-x86_64-with-glibc2.39
- Python version: 3.12.3
- Huggingface_hub version: 0.34.3
- Safetensors version: 0.5.3
- Accelerate version: 1.10.0
- Accelerate config:    not found
- DeepSpeed version: 0.17.4
- PyTorch version (accelerator?): 2.8.0a0+5228986c39.nv25.06 (CUDA)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: <fill in>
- Using GPU in script?: <fill in>
- GPU type: NVIDIA H100 80GB HBM3

### Who can help?

Previous PRs from: https://github.com/huggingface/transformers/pull/35207 and https://github.com/huggingface/transformers/pull/34511

It makes the backward() called after rescaling. This creates a double rescaling both here and in Accelerate:

https://github.com/huggingface/accelerate/blob/23cf4ef8a3b58f016f63eeb158b4aa2c3e79fe6f/src/accelerate/accelerator.py#L2724

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

When:

* gradient_accumulation_steps > 1 
* not using deepspeed
* num_items_in_batch is None and self.compute_loss_func is None (i.e., when user ignores the GA loss bug)

The final loss is rescaled twice:
```
loss = loss / gradient_accumulation_steps
```

### Expected behavior

It should be rescaled only once.

Comments:
okay, maybe https://github.com/huggingface/transformers/pull/34511 states this repo will no longer rely on Accelerate API for GA anymore? So.. just ignore this issue is what we expect?

Gradient accumulation in Trainer and Accelerate are independent. Trainer doesn’t use Accelerate’s gradient accumulation setting, so as long as you haven’t set gradient accumulation steps in both, it should be fine

> as long as you haven’t set gradient accumulation steps in both, it should be fine

And even in this case there is a sanity check anyway, if I'm not mistaken:

https://github.com/huggingface/transformers/blob/f4d57f2f0cdff0f63ee74a1f16f442dfaf525231/src/transformers/trainer.py#L5210-L5216

@qgallouedec Thanks for your response. It is indeed confusing, but you are correct, looks like the `self.trainer.accelerator.gradient_accumulation_steps` is set agnostic to the upper Trainer layer now.

It wasn't the case a few months ago, things change fast here 🥲. Anyway, thank you for your help!
🌐 [i18n-KO] Translated `vitdet.md` to Korean
Author: jihyun-0611
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다 -->
# What does this PR do?

Translated the ``vitdet.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]]`)
- [x] Check live-preview for gotchas (live-preview로 정상작동 확인)

## Who can review? (Initial)

<!-- 1. 위 체크가 모두 완료된 뒤에만 KREW 팀원들에게 리뷰를 요청하는 아래 주석을 노출해주세요!-->
May you please review this PR?
<!-- @jungnerd, @luckyvickyricky, @chelsseeey, @skwh54, @amo33, @maximizemaxwell, @D15M4S -->
<!-- @harheem, @nsbg, @Youngdong2, @xhaktm00, @ssunbear, @ChoHyoungSeo, @judy-choi -->
<!-- @4N3MONE, @Kim-Ju-won, @ahnjj, @FacerAin, @ssum21, @TaskerJang, @HyunZ118 -->
@yijun-lee, @songi104, @chhaewxn, @AhnJoonSung, @jihyun-0611, @seopp, @pyapyapya

## 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. KREW 팀원들의 리뷰가 끝난 후에 아래 주석을 노출해주세요! -->
<!-- @stevhliu May you please review this PR? -->

Comments:
🌐 [i18n-KO] Translated `main_classes/deepspeed.md` to Korean
Author: ChoHyoungSeo
Pull request: yes

# What does this PR do?

Translated the `main_classes/deepspeed.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]]`)
- [x] Check live-preview for gotchas (live-preview로 정상작동 확인)

## Who can review? (Initial)

May you please review this PR?
<!-- @4N3MONE, @yijun-lee, @jungnerd , @harheem -->

## 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)


Comments:
@ChoHyoungSeo 형서님! PR 감사합니다.
[Resolve conflicts] 버튼을 통해 문서 충돌을 해결해주시면 approved 하겠습니다 🤗

Would you mind rebasing to fix the CI tests? I'll also merge this for you once we've ironed out an issue with the doc-builder! 🤗
unpin `torchcodec==0.5.0` and use `torch 2.8` on daily CI
Author: ydshieh
Pull request: yes

Reverts huggingface/transformers#40013

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

Merge directly so we can have a CI run with this update that compare to a previous run with same commit
Add a VGGT(Visual Geometry Grounded Transformer) model compatible with huggingface transfromers
Author: DDsacu
Pull request: yes

This PR adds the VGGT (Visual Geometry Grounded Transformer) model to the Hugging Face Transformers library.
It includes:
- `VggtConfig`, `VggtModel`
- Integration into the Auto classes (`AutoConfig`, `AutoModel`).
- Basic unit tests for configuration, save/load, and forward pass.
- [WIP]Model documentation in `docs/source/en/model_doc/vggt.mdx`. 


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier

Library:

- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1

Integrations:

- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber

Documentation: @stevhliu

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->


Comments:
I'm not familiar with this model, cc @qubvel!

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

run-slow: auto
How can I make the logging utils log to a file as well? 
Author: howardlau1999
Pull request: no

# 🚀 Feature request

I want to make the logging utils log to a file in addition to the console. But I can't find an API that lets me add a handler to the logging utils.


Comments:
I just realize that I can enable the propagation and add the file handler to logging.root

> I just realize that I can enable the propagation and add the file handler to logging.root

how? can you please provide the example code, if possible.

> > I just realize that I can enable the propagation and add the file handler to logging.root
> 
> how? can you please provide the example code, if possible.

@sid8491 add this piece of code at the beginning of your script
```python
file_formatter = logging.Formatter(fmt="%(asctime)s - %(levelname)s - %(name)s -   %(message)s",
                                       datefmt="%m/%d/%Y %H:%M:%S", )
file_handler = logging.FileHandler(
    os.path.join(training_args.output_dir, f"log.{os.getpid()}.{training_args.local_rank}.txt"))
file_handler.setFormatter(file_formatter)
logging.root.addHandler(file_handler)
```

@howardlau1999 Thank you for providing the solution. However, after I set it up this way, I found that the log in the main.py script can be logged to the file properly. However, the logs in other python scripts (such as trainer.py) are not logged to the file. In addition, everything is fine to be logged in the command line. Have you encountered this situation?

This is still an issue, is there a simple way to send all logs to a file?
[GLM4V] fix vision placeholder mask
Author: zucchini-nlp
Pull request: yes
Labels: name: for patch

# What does this PR do?

As per title, GLM uses only `image_token_id` to denote both inputs and doesn't do mixed input inference

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

run-slow: glm4v

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

Oke, seems like ot was fixed when adding the new GLM4V MoE model