noamaanMulla-03/transformers-issues huggingface dataset:
[i18n-<languageCode>] Translating docs to <languageName>czech republic
Author: Denyweeeed
Pull request: no

<!--
Note: Please search to see if an issue already exists for the language you are trying to translate.
-->

Hi!

Let's bring the documentation to all the <languageName>-speaking community 🌐 (currently 0 out of 267 complete)

Who would want to translate? Please follow the 🤗 [TRANSLATING guide](https://github.com/huggingface/transformers/blob/main/docs/TRANSLATING.md). Here is a list of the files ready for translation. Let us know in this issue if you'd like to translate any, and we'll add your name to the list.

Some notes:

* Please translate using an informal tone (imagine you are talking with a friend about transformers 🤗).
* Please translate in a gender-neutral way.
* Add your translations to the folder called `<languageCode>` inside the [source folder](https://github.com/huggingface/transformers/tree/main/docs/source).
* Register your translation in `<languageCode>/_toctree.yml`; please follow the order of the [English version](https://github.com/huggingface/transformers/blob/main/docs/source/en/_toctree.yml).
* Once you're finished, open a pull request and tag this issue by including #issue-number in the description, where issue-number is the number of this issue. Please ping @ArthurZucker, @sgugger for review.
* 🙋 If you'd like others to help you with the translation, you can also post in the 🤗 [forums](https://discuss.huggingface.co/).

## Get Started section

- [ ] [index.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/index.md) https://github.com/huggingface/transformers/pull/20180
- [ ] [quicktour.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/quicktour.md) (waiting for initial PR to go through)
- [ ] [installation.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/installation.md).

## Tutorial section
- [ ] [pipeline_tutorial.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/pipeline_tutorial.md)
- [ ]  [autoclass_tutorial.md](https://github.com/huggingface/transformers/blob/master/docs/source/autoclass_tutorial.md)
- [ ]  [preprocessing.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/preprocessing.md)
- [ ]  [training.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/training.md)
- [ ]  [accelerate.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/accelerate.md)
- [ ]  [model_sharing.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/model_sharing.md)
- [ ]  [multilingual.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/multilingual.md)

<!--
Keep on adding more as you go 🔥
-->


Comments:
@Denyweeeed I would like to  contribute to the Telugu language translation

Please properly fill the template when opening such issues.
[docs] Performance docs tidy up, part 1 
Author: MKhalusova
Pull request: yes

The [performance and scalability section](https://huggingface.co/docs/transformers/v4.29.1/en/performance) of the docs is difficult to navigate and find actionable advice in, according to feedback. Some topics are missing too. As part of the 2023 docs roadmap, we planned to refactor the section to make the actionable bits easier and quicker to find. 

The refactor will come in several PRs to split it into more manageable chunks. This is the first part where you'll find: 
- reworked Overview for easier navigation
- reworked "Training on a single GPU" part. This part has been reorganized to have a clearer structure, the conceptual content has been clarified, the how to use/enable examples made visible, while the benchmarking comparison has been removed (it bloats the doc), instead there are links to benchmarks. 
Overall, I think that this section should now be easier to navigate and find actionable pieces with reasonable amount of explanation left in the doc, and relevant links for more information. 

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

> Also cc @lvwerra and @stas00 who contributed the original guide.

Thank you for the ping, Sylvain.

@lvwerra and I had two very different approaches on how to do the new documentation, and since we went with Leandro's way I will let Leandro comment on these changes.

Sorry about delay. I have moved the "Model training anatomy" part into a separate conceptual guide, and linked the two docs. This should address most of the concerns voiced in this discussion. Other feedback has also been incorporated. Please take another look: cc @lvwerra @sgugger 

Would you like to take another pass on this PR, @lvwerra ?
Support GatedRepoError + use raise from
Author: Wauplin
Pull request: yes

(PR started after comment from @osanseviero [on slack](https://huggingface.slack.com/archives/C03V11RNS7P/p1690185858721759?thread_ts=1689956871.406059&cid=C03V11RNS7P) -private link)

This PR adds 2 things:
- raise a more custom error in case of `GatedRepoError` when downloading a file. `GatedRepoError` is a subclass of `RepoNotFoundError` in which the repo is actually found but user don't have access to it (the inheritance is there for backward compatibility)
- when raising a EnvironmentError in `utils/hub.py` I think it's best to use the Python's syntax `raise ... from ...`. This make debugging much easier for both users and maintainers.

At the moment `GatedRepoError` is triggered only if token is passed but a [PR is moon-landing](https://github.com/huggingface/moon-landing/pull/7106) (private link) is opened to also trigger a gated repo error for unauthenticated users.

**Note:** there might be some tests to adapt and I'm willing to do it once the logic is approved

(EDIT: I just checked and in the lowest version of `huggingface_hub` that is supported (0.14.1), GatedRepoError [already exists](https://github.com/huggingface/huggingface_hub/blob/v0.14.1/src/huggingface_hub/utils/_errors.py#L108) so no import issue to worry about)

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

@sgugger thanks for the review :)
I made the requested change and updated another error message as well to use `token` instead of `use_auth_token` (the error message for generic `RepoNotFoundError`)
Better handling missing SYS in llama conversation tokenizer
Author: ichernev
Pull request: yes

The existing code failed to add SYS if the conversation has history without SYS, but does modify the passed conversation to include it.

Rearrange the code so modification to the conversation object are taken into account for token id generation.

Comments:
cc @ArthurZucker 

Hey! Could you elaborate on 
> failed to add SYS if the conv has history without SYS? 

The SYSTEM prompting should always go at the start of the whole conversation, thus we only check whether a system prompt is in the first prompt or not, because if you go through the conversational API, you should add the system prompt at the beginning. 

Is the usecase that you are requesting to be able to add a system prompt in the middle of the conversation ? 

Lets look at 2 use cases:
- **history (i.e more than 1 user message), no SYS in first message**: the code adds SYS to conversation, but then proceeds to use `dialogue` where SYS is not added. So model doesn't see SYS (incorrect). If the conversation is used again, then there will be SYS present (OK, I guess)
- **single (user) message in conversation (no `past_user_inputs`), no SYS in it**: the code adds SYS to `dialogue`, and the SYS ends up in the model input (correct), but the message/conversation is not modified (i.e if used again there will be no sys)

So there is discrepancy between what the model sees at this iteration and what would happen in the next iteration. So I changed the code to 1) first modify the conversation object, before `dialogue` is computed and 2) modify both the `past_user_inputs` and `new_user_input`, so no case will be left unhandled.

So now the model would see SYS in both cases, and the conversation is modified (for future use) in both cases.

An alternative is to modify the `dialogue` object only (it's just an array so that's even simpler - no difference between history and no history), then the conversation object would stay without SYS, but the model will see SYS every time.

@ArthurZucker ready for approval

_The documentation is not available anymore as the PR was closed or merged._
🌐[i18n-KO] Translated performance.md to Korean
Author: augustinLib
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다! -->
# What does this PR do?

Translated the `performance.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. 위 체크가 모두 완료된 뒤에, 이 아래에 리뷰를 요청할 팀원들을 멘션해주세요! -->
May you please review this PR? @0525hhgus, @Sunmin0520, @54data, @seank021, @kihoon71

## 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)

<!-- 2. 팀원들과 리뷰가 끝난 후에만 허깅페이스 직원들에게 리뷰 요청하는 아래 주석을 노출해주세요! -->
May you please review this PR? @sgugger, @ArthurZucker, @eunseojo

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

리뷰 사항 없습니다!
🌐 [i18n-KO] Translated `testing.md` to Korean
Author: Sunmin0520
Pull request: yes

# What does this PR do?

Translated the `testing.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)


## 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)
@kihoon71, @0525hhgus, @54data, @seank021, @augustinLib

## Who can review? (Final)
May you please review this PR? @sgugger, @ArthurZucker, @eunseojo

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

위에 현서 멘토님께서 올려주신 것 외에는 리뷰 사항 없습니다!
Add dispatch_batches to training arguments
Author: muellerzr
Pull request: yes

# What does this PR do?

This PR adds the option to set `Accelerator`'s `dispatch_batches` argument through the `TrainingArguments`. This is needed in cases such as https://github.com/huggingface/transformers/issues/24999, when `dispatch_batches=False` is needed on the streaming dataset

Fixes # (issue)

Solves https://github.com/huggingface/transformers/issues/24999


## 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).
- [x] 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.

@sgugger 

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25038). All of your documentation changes will be reflected on that endpoint.
Make more test models smaller
Author: sgugger
Pull request: yes

# What does this PR do?

This PR continues on the work of #24824 by fixing the models used in more common tests. This is big enough to be reviewed, I'll do the last ones in a separate PR :-)

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

Yes we could go even smaller if we wanted to, but it's hard for big encoer/decoder models with backbones.
Pyramid Vision Transformer
Author: danielhoshizaki
Pull request: no
Labels: name: New model

### Model description

I would like to add the[ Pyramid Vision Transformer model](https://arxiv.org/abs/2102.12122).

#### Paper Abstract
Pyramid Vision Transformer~(PVT), has several merits compared to prior arts. (1) Different from ViT that typically has low-resolution outputs and high computational and memory cost, PVT can be not only trained on dense partitions of the image to achieve high output resolution, which is important for dense predictions but also using a progressive shrinking pyramid to reduce computations of large feature maps. (2) PVT inherits the advantages from both CNN and Transformer, making it a unified backbone in various vision tasks without convolutions by simply replacing CNN backbones. (3) We validate PVT by conducting extensive experiments, showing that it boosts the performance of many downstream tasks

### Open source status

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

### Provide useful links for the implementation

Model Implementation: https://github.com/whai362/PVT

Pretrained model weights for semantic segmentation: https://github.com/whai362/PVT/tree/v2/segmentation (based on ADE20K) 

Comments:
Hey @danielhoshizaki, Can I join you?

@danielhoshizaki , I would love to contribute for this new model.

Thanks for offering to help and sorry about the late response.
I'm going to have a go at this model and if I need any help I will let you know.

Sure @danielhoshizaki 

anyone working on this?
Pvt model
Author: Xrenya
Pull request: yes

# Add PVT(Pyramid Vision Transformer)


Partially fixes: [issue](https://github.com/huggingface/transformers/issues/17596), [Closed PR](https://github.com/huggingface/transformers/pull/22445)

## 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.
- [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?

@amyeroberts


From previous PR:

> PvtBlock which contains a PvtPatchEmbeddings layer and the subsequent PvtLayer layers. 
PvtLayer has depth, while PvtPatchEmbeddings only at the beginning of the each encoder block and it would be trailed along the whole depth without using or it would require extra logic to make it None and also would require to trail height and width.


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

@Xrenya Thanks again for adding and iterating. Merging now :)
[`8bit`] Fix 8bit corner case with Blip2 8bit
Author: younesbelkada
Pull request: yes

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/25011
Fixes https://github.com/huggingface/transformers/issues/25026

https://github.com/huggingface/transformers/pull/24095/ introduced a new check for retrieving the list of modules that are not needed to be quantized (e.g. LM head). While it works perfectly fine for text models, when using `model.named_children()`, the last element of that list would be the entire `language_model` module for `Blip2` models. This lead to the entire language model not being converted in 8bit by `replace_bnb_linear` method, leading to an 8bit bnb weight forced to be loaded on a `nn.Linear` module, hence the error. 

The fix is to use `model.named_parameters()` to correctly get the last parameter (usually the lm_head) and not the last children

cc @sgugger 

Will mark as ready for review once the slow tests are green


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

Tests are green, merging!
Add stride/chunking to `TextClassificationPipeline`
Author: boyleconnor
Pull request: yes

# What does this PR do?

Adds sliding window/chunking functionality to `TextClassificationPipeline` (similar to what #21771 did for `TokenClassificationPipeline`).

## 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).
- [x] 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.

@Narsil


Comments:
I happened to implement this for another project, so I went straight to implementing a PR here (skipping opening an issue) to see if this would be a desirable feature for HF. I realized after opening this PR that I haven't finished updating the docstrings where appropriate.

I could also use some guidance on when & where to return the result as a list vs. a list-of-lists; I'll admit I worked out [this section of code](https://github.com/huggingface/transformers/blob/52253ed1b1722a8e60e2df29ce0b1339dce07d9f/src/transformers/pipelines/text_classification.py#L222) mainly through trial-and-error with the existing test suite--not an ideal way to program.

Much of this code is copied/adapted from `TokenClassificationPipeline`. It looks like the changes also broke the legacy functionality of text pairs as shown in tests such as [`tests/models/bert/test_modeling_tf_bert.py::TFBertModelTest::test_pipeline_text_classification`](https://app.circleci.com/pipelines/github/huggingface/transformers/66591/workflows/85501b27-19f8-4dfe-a24e-242592463a89/jobs/829459); I think I can fix that if this new functionality turns out to be something the HuggingFace team wants to add.

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

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.
🌐 [i18n-KO] Translated `perf_train_cpu.md` to Korean
Author: seank021
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다 -->
# What does this PR do?

Translated the `perf_train_cpu.md` file of the documentation to Korean 😄 
Thank you in advance for your review!

Part of https://github.com/huggingface/transformers/issues/20179
<!-- 메인 이슈에 기록이 남아요! 가짜연구소 리포를 사용해 연습하실때는 제거해주시면 감사하겠습니다! :smile: -->

## 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. 위 체크가 모두 완료된 뒤에만 가짜연구소 팀원들에게 리뷰 요청하는 아래 주석을 노출해주세요! -->
<!-- Team PseudoLab, may you please review this PR?  -->
@kihoon71, @0525hhgus, @54data, @Sunmin0520, @seank021, @augustinLib

## 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. 가짜연구소 팀원들과 리뷰가 끝난 후에만 허깅페이스 직원들에게 리뷰 요청하는 아래 주석을 노출해주세요! -->
May you please review this PR?
@sgugger, @ArthurZucker, @eunseojo

Comments:
리뷰 사항 없습니다!

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

수고 많으셨습니다!!

저도 @0525hhgus 님의 댓글 부분 외에는 별도의 리뷰 사항 없습니다 :)