noamaanMulla-03/transformers-issues huggingface dataset:
dos: ko: llm_tutorial.md
Author: harheem
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.
-->

<!-- Remove if not applicable -->

Fixes # (issue)


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

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 and @younesbelkada
- vision models: @amyeroberts
- speech models: @sanchit-gandhi
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @gante
- pipelines: @Narsil
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @sgugger

Integrations:

- deepspeed: HF Trainer/Accelerate: @pacman100
- ray/raytune: @richardliaw, @amogkam

Documentation: @sgugger, @stevhliu and @MKhalusova

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: @sgugger
- TensorFlow: @Rocketknight1

 -->


Comments:
[MINOR:TYPO]
Author: cakiki
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.
-->

<!-- Remove if not applicable -->



## Before submitting
- [x] 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?
@sgugger 
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 and @younesbelkada
- vision models: @amyeroberts
- speech models: @sanchit-gandhi
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @gante
- pipelines: @Narsil
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @sgugger

Integrations:

- deepspeed: HF Trainer/Accelerate: @pacman100
- ray/raytune: @richardliaw, @amogkam

Documentation: @sgugger, @stevhliu and @MKhalusova

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: @sgugger
- TensorFlow: @Rocketknight1

 -->


Comments:
Bug: dataclasses.FrozenInstanceError: cannot assign to field generation_config
Author: vasuems
Pull request: no

### System Info

Hi @julien-c 

I am getting error dataclasses.FrozenInstanceError: cannot assign to field generation_config.

Transformer Version: Latest. Build from source.
Cuda: 11.5
Python: 3.10

Execute the script /scripts/finetune_llama2_guanaco_7b.sh using qlora repository. I am getting the below error.

qlora.py", line 841, in <module>
    train()
  qlora.py", line 694, in train
    training_args.generation_config = transformers.GenerationConfig(**vars(generation_args))
  File "qlora/.venv/lib/python3.10/site-packages/transformers/training_args.py", line 1714, in __setattr__
    raise FrozenInstanceError(f"cannot assign to field {name}")
dataclasses.FrozenInstanceError: cannot assign to field generatio

Can you give pls suggest me a solution to fix this issue? 

### 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, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

Clone qlora repo https://github.com/artidoro/qlora.git.

Execute the script under scripts folder: finetune_llama2_guanaco_7b.sh. 

### Expected behavior

the script should train the default inbuilt model. But the script throws the above error.

Comments:
You should report the issue on that repo. It is not possible to change the training arguments once instantiated, so the script you are using needs fixing :-)

Thanks.

Closing the issue.
TF 2.14 compatibility
Author: Rocketknight1
Pull request: yes

This PR adds compatibility with TF 2.14. Right now it just updates the pin to see what breaks, but hopefully I'll also fix the things that have broken, if the mood takes me.

Comments:
_The documentation is not available anymore as the PR was closed or merged._

Amazingly, except the Hub tests, this seems to just work! I did some manual testing with 2.14-rc0 on my local machine and all tests seem to pass.

cc @ArthurZucker for core maintainer review
removing unnecesssary extra parameter
Author: rafaelpadilla
Pull request: yes

# What does this PR do?

Fix errors raised when function `self.normalize_annotation` is called in 3 models. 

There are 3 models (`conditional detr`, `deformable detr` and `detr`), whose `self.normalize_annotation` functions do not receive the `input_data_format` parameter. 

`input_data_format` parameter was introduced in [PR #25464](https://github.com/huggingface/transformers/pull/25464) to allow images with unusual number of channels to be used. However, functions like `self.normalize_annotation` deal with annotations only, and don't need this parameter. In fact, this parameter raises an error, as it is not defined in the signature of the functions `self.normalize_annotation`.

## 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#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?
@amyeroberts 


Comments:
_The documentation is not available anymore as the PR was closed or merged._
Reflexion Agent implementation?
Author: ghosthamlet
Pull request: no

### Feature request

Reflexion: Language Agents with Verbal Reinforcement Learning (https://arxiv.org/abs/2303.11366) has code in  https://github.com/noahshinn024/reflexion, can you integrate it into transformers_agents?

### Motivation

Reflexion Agent is a very interesting advanced agent, and already has its code open sourced, can it be easy to integrate it into transformers_agents?

### Your contribution

Currently no.

Comments:
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.
Add Context AutoEncoder (CAE)
Author: charlesCXK
Pull request: no
Labels: name: New model

### Model description

**The corresponding paper has been accepted by International Journal of Computer Vision (IJCV).**

We present a novel masked image modeling (MIM) approach, context autoencoder (CAE), for self-supervised representation pretraining. We pretrain an encoder by making predictions in the encoded representation space. The pretraining tasks include two tasks: masked representation prediction - predict the representations for the masked patches, and masked patch reconstruction - reconstruct the masked patches. The network is an encoder-regressor-decoder architecture: the encoder takes the visible patches as input; the regressor predicts the representations of the masked patches, which are expected to be aligned with the representations computed from the encoder, using the representations of visible patches and the positions of visible and masked patches; the decoder reconstructs the masked patches from the predicted encoded representations. The CAE design encourages the separation of learning the encoder (representation) from completing the pertaining tasks: masked representation prediction and masked patch reconstruction tasks, and making predictions in the encoded representation space empirically shows the benefit to representation learning. We demonstrate the effectiveness of our CAE through superior transfer performance in downstream tasks: semantic segmentation, object detection and instance segmentation, and classification.

### Open source status

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

### Provide useful links for the implementation

Code link: https://github.com/Atten4Vis/CAE
Author: @charlesCXK
Paper link: https://arxiv.org/abs/2202.03026

Comments:
I would like to work towards adding this model to huggingface transformers @NielsRogge



cc @amyeroberts @rafaelpadilla 

Hi @charlesCXK, thanks for opening this model request! 

The easiest and recommended way to make a model available in `transformers` is to add the modeling code directly on the hub: https://huggingface.co/docs/transformers/custom_models. This means, once working, the model can be found and used immediately without having to go through the PR process. We find this is a lot quicker as the bar for adding code into the library is high due to the maintenance cost of every new model, and so reviews take quite a while.
Add input_embeds functionality to gpt_neo Causal LM
Author: gaasher
Pull request: yes

This PR follows up on https://github.com/huggingface/transformers/pull/21405, https://github.com/huggingface/transformers/pull/21889, and https://github.com/huggingface/transformers/pull/22916 by @gante to GPTNeoCausalLM models, which allows these models to accept input_embeds when generating.

## Who can review?

@gante @sgugger 


Comments:
(CI can be fixed by running `make fixup` on transformers root, then committing the changes)

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25659). All of your documentation changes will be reflected on that endpoint.

> (CI can be fixed by running `make fixup` on transformers root, then committing the changes)

Just did this!
`self.tokenizer` is nil in example code
Author: adsr
Pull request: no

### System Info

- `transformers` version: 4.33.0.dev0
- Platform: Linux-6.1.0-9-amd64-x86_64-with-glibc2.36
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- Safetensors version: 0.3.2
- Accelerate version: not installed
- Accelerate config: not found
- PyTorch version (GPU?): 2.0.1+cu117 (False)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: N
- Using distributed or parallel set-up in script?: N


### Who can help?

 @ArthurZucker @younesbelkada @sgugger

### Information

- [ ] The official example scripts
- [X] 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

(Apologies if I have something wrong in my setup.) I'm running into an error while following along with a simple example from https://huggingface.co/tasks/text-generation:

```
user@host:~/test$ venv/bin/python -c 'from transformers import pipeline; pipe = pipeline("text-generation", model="cerebras/btlm-3b-8k-base", trust_remote_code=True); print(pipe("hello world", max_length=1, num_return_sequences=1))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/test/test/venv/lib/python3.11/site-packages/transformers/pipelines/text_generation.py", line 204, in __call__
    return super().__call__(text_inputs, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/test/venv/lib/python3.11/site-packages/transformers/pipelines/base.py", line 1129, in __call__
    return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/test/venv/lib/python3.11/site-packages/transformers/pipelines/base.py", line 1135, in run_single
    model_inputs = self.preprocess(inputs, **preprocess_params)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/test/venv/lib/python3.11/site-packages/transformers/pipelines/text_generation.py", line 207, in preprocess
    inputs = self.tokenizer(
             ^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable
user@host:~/test$ 
```

For readability, here is the same Python code formatted:

```python
from transformers import pipeline
pipe = pipeline("text-generation", model="cerebras/btlm-3b-8k-base", trust_remote_code=True)
print(pipe("hello world", max_length=1, num_return_sequences=1))
```

### Expected behavior

No exception, or a friendlier one

Comments:
I just noticed the example code on https://huggingface.co/cerebras/btlm-3b-8k-base differs from https://huggingface.co/tasks/text-generation. That's probably it.
[`SPM`] Patch `spm` Llama and T5
Author: ArthurZucker
Pull request: yes

# What does this PR do?
An edge case was found, so we need to find a more reliable way to make sure we don't strip the first token, but also have the correct length. 

Previously, we would strip `>` from a tokenization if `f">>"` exists in the vocab  ( and `unk_token = <unk>`). 

Before:
```python 
tokenizer.tokenize("Hey 
>")
['▁Hey', '▁', '
']
```
after
```python 
tokenizer.tokenize("
>")
['▁Hey', '▁', '
', '>']
```
The new logic makes more sense too. 

# Why was this not caught before? 
Because the common spm tests only use the `sample_vocab` and since it is an edge case, did not appear in the different integration tests. 

# TODO
Add more and more edge cases.... Let's make sure this is the last one. Will add a pr for tests, cc @sgugger 

Comments:
_The documentation is not available anymore as the PR was closed or merged._
[`GPTNeo`]  Add input_embeds functionality to gpt_neo Causal LM 
Author: ArthurZucker
Pull request: yes

# What does this PR do?
Follow PR of #25659, were model inputs are updated with the input ids, meaning both input ids and input embeds are passed. 

Comments:
_The documentation is not available anymore as the PR was closed or merged._

> yeah, a test would be helpful, at least on the models that have `inputs_embeds` in the signature of this fn! Sloppy reviewers (me!) miss issues like this one
> 
> cc @ydshieh -- lmk if you'd like to add it, or if you'd prefer me to add it :)

I would appreciate you do it (you have super clear of the context already) - happy to review the PR !
Add type hints to Blip2QFormer,  BigBirdForQA and ConditionalDetr family models
Author: nablabits
Pull request: yes

# What does this PR do?

Addresses a few type hints in https://github.com/huggingface/transformers/issues/16059

## Who can review?
@Rocketknight1 please


Comments:
_The documentation is not available anymore as the PR was closed or merged._
[i18n-KO] Translated docs: ko: pr_checks.md to Korean
Author: sronger
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다! -->
# What does this PR do?

Translated the `pr_checks.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)

@sronger, @TaeYupNoh, @kj021, @HanNayeoniee, @eenzeenee, @sim-so

## 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)

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_24987). All of your documentation changes will be reflected on that endpoint.

Translation completed!
May you please review this PR? :)
@sgugger, @ArthurZucker, @eunseojo, @stevhliu
fix wrong path in some doc
Author: ydshieh
Pull request: yes

# What does this PR do?

The examples use a path this is (likely) moved to the current one some time ago. Let's update those.

Comments:
Pong Sir Arthur 😄 

can give it a try!

It passes, but doctest doesn't really run any test from that doc file. (nothing is collected)

See https://app.circleci.com/pipelines/github/huggingface/transformers/71009/workflows/d047f9a7-21ee-457b-b921-05eefbeedd88/jobs/892220/steps

_The documentation is not available anymore as the PR was closed or merged._

Most of them are `bash`. Some are `python`, but as `python no-style`. There is a single block with `python`, but that is not really to be tested as a doc string example.

I didn't check the regular expression to see why those python-related blocks are not tested.

It's probably that file has `cuda`, and for `md` file, if a `cuda` shows up, all the tests in that file won't be collected (by the new logic of doc test you and me implemented)
Remove `utils/documentation_tests.txt`
Author: ydshieh
Pull request: yes

# What does this PR do?

Let's remove `utils/documentation_tests.txt` and just keep `not_doctested.txt`

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25680). All of your documentation changes will be reflected on that endpoint.