noamaanMulla-03/transformers-issues huggingface dataset:
[i18n-<languageCode>] Translating docs to <languageName>
Author: johnihsususjd
Pull request: no
Labels: name: WIP

<!--
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.mdx](https://github.com/huggingface/transformers/blob/main/docs/source/en/index.mdx) https://github.com/huggingface/transformers/pull/20180
- [ ] [quicktour.mdx](https://github.com/huggingface/transformers/blob/main/docs/source/en/quicktour.mdx) (waiting for initial PR to go through)
- [ ] [installation.mdx](https://github.com/huggingface/transformers/blob/main/docs/source/en/installation.mdx).

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

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

Comments:
BioGPTForSequenceClassification
Author: GuillemGSubies
Pull request: no
Labels: name: Good First Issue

### Feature request

It would be nice to have this available.

### Motivation

I'm studying some biomedical classification datasets and I would like to try BioGPT with them.

### Your contribution

I could send a PR if you want. I guess it shouldn't be too hard, I could look at another model trained with Casual LM and implement `BioGPTForSequenceClassification` like that one, am I right?

Comments:
Sure, see this PR as an example: https://github.com/huggingface/transformers/pull/18123

Ty so much, I'll give it a try.

@GuillemGSubies There has been no activity on your PR #21535 since a while. I would like to fix the issue and complete the PR. Should I proceed? Are you still working on this issue? 

You can take it, I'm not working on it right now

Hello @awinml , were you able to resolve this issue? If not I'd be interested in working on this problem.

@jprivera44 Yeah, I am still working on it. Most of the work is done. There's just one test left to be fixed. I will mostly fix it up by the end of this week.

@awinml are u still working on this issue??


@sushmanthreddy As mentioned in https://github.com/huggingface/transformers/issues/21530#issuecomment-1504765529, I am still working on the issue. There is only one failing test left to be fixed. The PR is still under review, hence the inactivity.
Depricate xpu_backend for ddp_backend
Author: muellerzr
Pull request: yes
Labels: name: Distributed Training / Models

name: trainer

# What does this PR do?

This PR depricates the `xpu_backend` training argument for a new `ddp_backend` argument that can be passed to the `AcceleratorState` directly when desired/appropriate. 

Fixes # (issue)


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#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.

@sgugger 

Comments:
_The documentation is not available anymore as the PR was closed or merged._
🌐 [i18n-KO] Translated `tasks/image_classification.mdx` to Korean
Author: 0525hhgus
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.mdx` to Korean" 으로 부탁드립니다 -->
# What does this PR do?

Translated the `tasks/image_classification.mdx` 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? 
@0525hhgus, @KIHOON71, @sim-so, @gabrielwithappy, @HanNayeoniee, @wonhyeongseo, @jungnerd

## 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._

May you please review this PR? 😄 
@sgugger, @ArthurZucker, @eunseojo
Using data collator in `Pipeline`
Author: neilkimn
Pull request: no

Hello,
I am in the process of moving a bunch of pre- and post-processing logic to use the [Pipeline](https://huggingface.co/docs/transformers/main_classes/pipelines). In my original code I would use a data collator in my `Trainer` constructor to take care of padding inputs among other things. The `Trainer` then takes care of collating data for both training and evaluation.

I could move the logic within the collator into the processing of the pipeline, but I want to keep the code as similar as possible when using the `Trainer` for training specifically, and when I use the pipeline during inference or evaluation. 

What could be the best way to go about this? In the more general case I could just scrap the pipeline and opt for a torch dataloader and run evaluation with that, but I am interested in keeping the pipeline around as I am inheriting some logic for aggregation around. I also think the ability to encapsulate pre- and post-processing in the pipeline is useful.

Comments:
I'm not too sure where the question is here. Each `Pipeline` has the pre/post-processing logic they need implemented in their `preprocess` and `postprocess` methods.
Import Error: cannot import name 'TFBertTokenizer' from 'transformers'
Author: shabha7092
Pull request: no

### System Info


Platform - Mac os
Python Version - 3.9.0
Tensorflow version - 2.10.0
Transformers version - 4.23.1 (Tried different version)








### Who can help?

 @LysandreJik

### Information

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

when i try to import TFBertTokenizer using the statement “from transformers import TFBertTokenizer” i come across the below error.

ImportError: cannot import name ‘TFBertTokenizer’ from ‘transformers’

I am able to import BertTokenizer though. Did something change ? If i recollect i was able to import TFBertTokenizer too in the past. i also happen to check the code base and the class TFBertTokenizer still exists as part of the transformer package

Steps to Reproduce:
1) pip install transformers
2) In a new shell execute the below statement
'from transformers import TFBertTokenizer'


### Expected behavior

TFBertTokenizer should be imported similar to BertTokenizer. 

Comments:
`TFBertTokenizer` is in the main init but it's a fairly recent addition. Are you certain you have the latest version of Transformers? You can print it with `from transformers import __version__; print(__version__)`

@sgugger For some reason transformer version was showing 4.20.1 when i ran the above command. I updated it to 4.23.1 and now i dont see any error. Thank you fo your time. 

how u are update the version?????

@Amlalqhtani pip install --upgrade transformers
WER = 100% !! (Whisper medium)
Author: Seif-aber
Pull request: no

Hello everyone,

I am having an issue when finetuning OpenAI's Whisper Medium on Mozilla's Common Voice 11 Dataset with the Arabic language.
The training and validation loss are both decreasing but the WER is being 100% after some steps (specially when the loss becomes < 1) and I see that the model is performing well and that WER is just miscalculated.
![hf_issue](https://user-images.githubusercontent.com/96656595/232808398-936c0e2b-f8b3-4289-a6bd-f21f64236efe.png)

Notes :

- This error is just happening with the medium model, other models (small, tiny, large-v2 ,etc.) are working fine.
- I am following the famous blog about Whisper's finetuning (https://huggingface.co/blog/fine-tune-whisper).
@sanchit-gandhi 

Comments:
Hi @Seif-aber, thanks for raising this issue! 

So that we can best help, could you share the running environment: run `transformers-cli env` in the terminal and copy-paste the output. 

Have you looked any of the inputs to/ outputs of the model when this occurs? After the model has finished training, if you feed a single sample to the model to predict in eval model, what does the prediction look like? 


Hey @Seif-aber! I believe I answered a duplicate of your question on the Hugging Face Hub earlier today: https://huggingface.co/spaces/openai/whisper/discussions/84#64466139e113660053727da7

My suggestions were similar to those of @amyeroberts - let's take a look at the predictions the model is making to work out what's going on.

Addressed on the HF Hub: https://huggingface.co/spaces/openai/whisper/discussions/84#644aa699af97dfd24c0e0767
[docs] broken link in `torchscript.mdx`
Author: sim-so
Pull request: no

### Description
Broken `serialization#using-torchscript-in-python` should be `torchscript#using-torchscript-in-python`, in line number 201 of `torchscript.mdx`.
### Document / language
`torchscript.mdx` / en, kr
### Suggestion
As is:
```
### Converting a model for AWS Neuron

Convert a model for AWS NEURON using the same code from [Using TorchScript in
Python](serialization#using-torchscript-in-python) to trace a `BertModel`. Import the
`torch.neuron` framework extension to access the components of the Neuron SDK through a
Python API:
```
To be:

```
### Converting a model for AWS Neuron

Convert a model for AWS NEURON using the same code from [Using TorchScript in
Python](torchscript#using-torchscript-in-python) to trace a `BertModel`. Import the
`torch.neuron` framework extension to access the components of the Neuron SDK through a
Python API:
```


Please let me know if I missed something in guideilnes.
Thank you in advance for your attention to it!

Comments:
Thanks for catching this! Would you like to open a PR with your fix? 🤗

Hello, @stevhliu !
I opened PR #23060 for translating the document to Korean as well as fixing the issue.
Please let me know if it would be better to open another PR for the fix separately.
GPT2ForQuestionAnswering
Author: peter-sk
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).
- [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?

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
@sgugger

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

@ArthurZucker @sgugger @younesbelkada The next one is ready for review.

This is a bit funny. The tests are fine, and it runs great on one of my 4x V100 machines. But on another machine, I get this funny error:

/home/jps/anaconda3/envs/scandeval/lib/python3.9/site-packages/transformers/trainer.py:375
/home/jps/anaconda3/envs/scandeval/lib/python3.9/site-packages/torch/nn/modules/module.py:1269
AttributeError: 'GPT2ForQuestionAnswering' object has no attribute 'model_parallel'

Any ideas? I though model_parallel was legacy and not needed. Should I add to be on the safe side? torch version is torch==1.13.1.

GPT2 is an old model so it might still be checking for `model_parallel`, which in this case has to be added! LMK if this fixes the issues 

@ArthurZucker ready for review!

cc @younesbelkada since Arthur is on vacation.
FLAVA: module 'torch.distributed.nn.functional' has no attribute 'all_gather_with_backprop'
Author: amariucaitheodor
Pull request: no

https://github.com/huggingface/transformers/blob/a0e733283930bdb9ae2b1afdc53ec5f2daefb033/src/transformers/models/flava/modeling_flava.py#L1696

The following error is thrown when running FLAVA with PyTorch 2.0 and `global_backprop_contrastive=True`: `AttributeError: module 'torch.distributed.nn.functional' has no attribute 'all_gather_with_backprop'`. As far as I know, this attribute never existed in PyTorch.

 The bug might have to do with the fact that `all_gather` is renamed to `all_gather_with_backprop` in [facebookresearch/multimodal](https://github.com/facebookresearch/multimodal) and this could have been copied over: https://github.com/facebookresearch/multimodal/blob/c6f6e44ec6e0addfdf01695db860a6febeb2d88b/torchmultimodal/utils/distributed.py#L12

A rename to `all_gather` should fix this I think.

Comments:
cc @younesbelkada  and @amyeroberts 

Hi @amariucaitheodor 
This sounds like being the correct fix in my opinion. I can't find that method either on the PT documentation, and I guess we never flagged that issue as not many users have run the model in a distributed mode..
Would you mind opening a PR for that? If you can't, happy to do it!
[`Flava`] Fix flava `torch.distributed.nn.functional import all_gather` issue
Author: younesbelkada
Pull request: yes

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/23047
Flava had some code that were copy-pasted from the original repository: https://github.com/facebookresearch/multimodal/blob/c6f6e44ec6e0addfdf01695db860a6febeb2d88b/torchmultimodal/utils/distributed.py#L12 
From my understanding, It seems that there are two versions of `all_gather`: 
- `torch.distributed.nn.functional.all_gather` that backpropagates the gradients to all workers
- `torch.distributed.all_gather` that will backpropagate the gradients to the current worker only

cc @sgugger  


Comments:
_The documentation is not available anymore as the PR was closed or merged._
AttributeError: 'Tensor' object has no attribute 'tile'
Author: nikita-stha
Pull request: no

### System Info

- `transformers` version: 4.27.3
- Platform: Linux-5.10.147+-x86_64-with-glibc2.31
- Python version: 3.9.16
- Huggingface_hub version: 0.13.3
- PyTorch version (GPU?): 1.7.1 (True)
- Tensorflow version (GPU?): 2.11.0 (True)
- Flax version (CPU?/GPU?/TPU?): 0.6.7 (gpu)
- Jax version: 0.4.6
- JaxLib version: 0.4.6
- Using GPU in script?: yes
- Using distributed or parallel set-up in script?: no


### Who can help?

_No response_

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

Try to run the code below:

from transformers import GPTNeoForCausalLM, GPT2Tokenizer

model = GPTNeoForCausalLM.from_pretrained("EleutherAI/gpt-neo-1.3B")
tokenizer = GPT2Tokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")

prompt = (
    "In a shocking finding, scientists discovered a herd of unicorns living in a remote, "
    "previously unexplored valley, in the Andes Mountains. Even more surprising to the "
    "researchers was the fact that the unicorns spoke perfect English."
)

input_ids = tokenizer(prompt, return_tensors="pt").input_ids

gen_tokens = model.generate(
    input_ids,
    do_sample=True,
    temperature=0.9,
    max_length=100,
)
gen_text = tokenizer.batch_decode(gen_tokens)[0]

### Expected behavior

I would expect model to generate the predicted next sentence/text.

Comments:
PyTorch 1.7 is not supported anymore, we only ensure support for PyTorch >= 1.9 Could you try updating your Pytorch install and see if it fixes the issue?

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.
llama model cannot run with accelerate setting
Author: TeddLi
Pull request: no

### System Info

transformer version 4.28.0.dev0
Error 
`loading file tokenizer_config.json
loading weights file ./llama1/pytorch_model.bin
Generate config GenerationConfig {
  "_from_model_config": true,
  "bos_token_id": 0,
  "eos_token_id": 1,
  "pad_token_id": 1,
  "transformers_version": "4.28.0.dev0"
}

[15:28:22] WARNING  Sending process 854275 closing signal SIGTERM                                                                                                        api.py:699
           WARNING  Sending process 854276 closing signal SIGTERM                                                                                                        api.py:699
           WARNING  Sending process 854277 closing signal SIGTERM                                                                                                        api.py:699
           WARNING  Sending process 854279 closing signal SIGTERM                                                                                                        api.py:699
           WARNING  Sending process 854280 closing signal SIGTERM                                                                                                        api.py:699
           WARNING  Sending process 854281 closing signal SIGTERM                                                                                                        api.py:699
           WARNING  Sending process 854282 closing signal SIGTERM                                                                                                        api.py:699
[15:28:25] ERROR    failed (exitcode: -9) local_rank: 3 (pid: 854278) of binary: /usr/bin/python3          `

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

We tried to train Pile with accelerate 8 GPUs setting

### Expected behavior

I would expect it load succesfully

Comments:
Please follow the template of the issues as there is nothing anyone can do to help with so little information.

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.