noamaanMulla-03/transformers-issues huggingface dataset:
[`CI`]  Fix red CI and ERROR failed should show
Author: ArthurZucker
Pull request: yes

# What does this PR do?
Fixes the main branch after the merge of #25895 which has a typo when checking the outputs of the ci tests.

Two part fix:
1. Fatal errors were not shown in the outputs so we don't know what was wrong 
```diff
- if x.startswith("FAILED ")]); fp.close(); fp = open("summary_short.txt", "w"); fp.write(failed); fp.close()'
+ if x.startswith("FAILED ", "ERROR ")]); fp.close(); fp = open("summary_short.txt", "w"); fp.write(failed); fp.close()'
```
3. Fix the error:
```diff
- check_test_command = f'if [ -s reports/test_{self.name}/failures_short.txt ]; '
+ check_test_command = f'if [ -s reports/{self.name}/failures_short.txt ]; '
```
should do the trick

3. There is now https://github.com/huggingface/transformers/commit/8d518013efbd10c178dd0dba0f9ba93229e2e78a that broke main, marking the test as slow 😉 

Comments:
_The documentation is not available anymore as the PR was closed or merged._
Implement HybridNets: End-to-End Perception Network
Author: chainyo
Pull request: no
Labels: name: New model

# 🌟 New model addition

## Model description

Quote from the Github repository:

```markdown
HybridNets is an end2end perception network for multi-tasks.    
Our work focused on traffic object detection, drivable area segmentation and lane detection.   
HybridNets can run real-time on embedded systems, and obtains SOTA Object Detection, 
Lane Detection on BDD100K Dataset.
```

## Open source status

* [x] the model implementation is available: yes, they have pushed everything [here](https://github.com/datvuthanh/HybridNets) on Github
* [x] the model weights are available: yes, there are available directly [here](https://github.com/datvuthanh/HybridNets/releases/download/v1.0/hybridnets.pth) on Github.
* [x] who are the authors: Dat Vu  and Bao Ngo and Hung Phan (@xoiga123 @datvuthanh)


Btw, I would love to help to implement this kind of models to the Hub if possible :hugs: .
But I don't know if it fits to `Transformers` library or not and if it involves a lot of work to implement it, but I want to try to help!

Comments:
cc @NielsRogge 

Hi @chainyo, thanks for opening this new model request! 

Here's a guide on adding a model to the hub if you, or anyone else in the community is still interested: https://huggingface.co/docs/transformers/custom_models
Fix small typo README.md
Author: zspo
Pull request: yes

# What does this PR do?

1. update paper links in readme
2. fix other small bugs in .md

## Who can review?

Documentation: @stevhliu and @MKhalusova


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25934). All of your documentation changes will be reflected on that endpoint.
modify context length for GPTQ + version bump
Author: SunMarc
Pull request: yes

# What does this PR do ? 
This PR adds the possibility to change the max input length when using exllama backend + act_order. We also bump the required version of gptq to `0.4.2`. 
The gptq tests passed and I skipped a test because we need to wait for a release on optimum side. 

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

It works with the new model path :)
Fix err with FSDP
Author: muellerzr
Pull request: yes

# What does this PR do?

One potential solution for https://github.com/huggingface/transformers/issues/25988, we need to guard for things in Accelerate main better for items, especially items like fsdp and deepspeed

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.

@pacman100 

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

@pacman100 sounds good, let me know if you are pleased :) 

Ran into this issue too, confirmed this PR resolves for us.
conversational + text-generation pipelines fail to read max_length from GenerationConfig
Author: yonigottesman
Pull request: no

### System Info

- `transformers` version: 4.32.0.dev0
- Platform: macOS-13.3.1-arm64-arm-64bit
- Python version: 3.10.5
- Huggingface_hub version: 0.16.4
- Safetensors version: 0.3.1
- Accelerate version: not installed
- Accelerate config: not found
- PyTorch version (GPU?): 2.0.1 (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?: false
- Using distributed or parallel set-up in script?: false

### Who can help?

@Narsil @gante 

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

~~~
pipe = pipeline("conversational", model="facebook/blenderbot_small-90M")
conv = Conversation("Does money buy happiness?" * 80)
gc = GenerationConfig(max_length=512)
pipe(conv, generation_config=gc)
~~~

This trims the input and log this message:
`Conversation input is to long (401), trimming it to (128 - 10)`
Even though I asked for `max_length=512` becase it ignores the gc and takes the models default

### Expected behavior

I expect the pipeline code to consider the `GenerationConfig` max_length but I see in the [code](https://github.com/huggingface/transformers/blob/main/src/transformers/pipelines/conversational.py#L269) that it just looks for the (deprecated) `max_length`.
There is a similar issue with the `text-generation` pipeline.

Ill be happy to open a pr and fix this. As I understand, I just need to check the `generate_kwargs` for a `generation_config` and check if it has a `max_length` or/and `max_new_tokens`.



Comments:
Hey @yonigottesman 👋  We are aware of this issue, where `GenerationConfig` is not being piped correctly at input verification time. This requires a pipeline-level change (and not simply a `Conversation`-level change), and we are working on it :)

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.
Fix CircleCI config
Author: ydshieh
Pull request: yes

# What does this PR do?

@ArthurZucker fixed (in #25995) my PR #25895, but there change had a minor issue.

The `startswith` method of python's `str` requires `startswith arg must be str or a tuple of str`.

Not a big deal, but currently we just lose showing the summary part (only the `failure_short.txt` being showed).

For example, see https://app.circleci.com/pipelines/github/huggingface/transformers/72336/workflows/87f9e28c-9b95-46a9-b306-36a9a371da2e/jobs/912355



Comments:
_The documentation is not available anymore as the PR was closed or merged._
[VITS] Fix nightly tests
Author: sanchit-gandhi
Pull request: yes

# What does this PR do?

Fixes the tokenizer integration test and multi-GPU test that failed on the nightly run: https://github.com/huggingface/transformers/actions/runs/6068405445/job/16461410319

The tokenizer fix is trivial (needed to update the commit ID)!

The multi-GPU test was failing because the output sequence length for VITS is a function of the model **inputs**, rather than being a function of the input **sequence lengths** only.

Let's say we have 2 GPUs over which we want to run DP:
* GPU 1 outputs a sequence length of `N`, which is computed based on the input in the first element of the batch `x`
* GPU 2 outputs a sequence length of `M`, which is computed based on the input in the second element of the batch `y`

=> there is nothing to enforce that `N = M`, since the VITS output sequence length is a function of the inputs. Thus, we cannot concatenate the inputs after running the forward pass, since they have different dims. 

```python
# pseudo code for data parallelism
input_1, input_2 = torch.split(input, 2, dim=0)

output_1 = model(input_1) 
output_2 = model(input_2)

output = torch.concatenate([output_1, output_2], dim=0)  # breaks because input_1 and input_2 have different sequence lengths
```

The fix for the test is to pass the same inputs to both GPUs, and disable the stochastic duration predictor. This way, we get consistent outputs across our GPUs.

Comments:
_The documentation is not available anymore as the PR was closed or merged._
Added HerBERT to README.md
Author: Muskan011
Pull request: yes

Resolved issue #26016 by adding HerBERT to README.md
Documentation: @stevhliu and @MKhalusova


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_26020). All of your documentation changes will be reflected on that endpoint.
HerBERT missing from list of supported models
Author: xenova
Pull request: no
Labels: name: Documentation

### System Info

n/a

### Who can help?

@stevhliu @MKhalusova 

### 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

HerBERT has a model_doc (https://huggingface.co/docs/transformers/main/en/model_doc/herbert), but is not in the README:
![image](https://github.com/huggingface/transformers/assets/26504141/eb2151c8-feec-40fc-9a34-646a181577d0)


### Expected behavior

It should be in the README :) 
For example:
```
1. **[HerBERT](https://huggingface.co/docs/transformers/model_doc/herbert)** released with the paper [KLEJ: Comprehensive Benchmark for Polish Language Understanding](https://www.aclweb.org/anthology/2020.acl-main.111.pdf) by Piotr Rybak, Robert Mroczkowski, Janusz Tracz, and Ireneusz Gawlik.
```

Comments:
I would like to work on this. @xenova 

I have fixed this issue but my PR requires review.
hidden_dropout_prob and attention_probs_dropout_prob values in the documentation doesn't match with that in the code
Author: SwapnanilMukherjee
Pull request: no

### System Info

- `transformers` version: 4.30.2
- Platform: Linux-5.15.0-79-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.16.2
- Safetensors version: 0.3.1
- PyTorch version (GPU?): 2.0.1+cu117 (True)
- 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?: RTX A5000
- Using distributed or parallel set-up in script?: No


### Who can help?

@sgugger 

### 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

I am training ViLT on e-SNLI-VE. This is basically what I am doing.
```
from transformers import ViltConfig, ViltProcessor, ViltForQuestionAnswering

label2id = {'contradiction':0, 'entailment':1, 'neutral':2}
id2label = {0:'contradiction', 1:'entailment', 2:'neutral'}

vilt_config = ViltConfig(label2id=label2id, id2label=id2label, max_position_embeddings=100)
vilt_config
```
This gives the following output. 
![Screenshot from 2023-08-22 02-21-17](https://github.com/huggingface/transformers/assets/63775342/22d449f5-a69c-4ad8-9a85-6e337a3edd83)
The values for both variables should be 0.1 as indicated by the documentation. 
![Screenshot from 2023-08-22 02-23-18](https://github.com/huggingface/transformers/assets/63775342/77fb4fbd-a041-4d16-aa5f-a27537864720)


### Expected behavior

The values of the variables should have been zero. 

Comments:
Thanks for catching the typo, would you like to open a PR to change the values to `0.0`? 🤗 

Yes, I'll do that right away. But should the value in the documentation or the model init be changed? 

I think the value should be changed in the docstring to reflect whats in the `init` (pinging @ArthurZucker for confirmation):

https://github.com/huggingface/transformers/blob/41aef33758ae166291d72bc381477f2db84159cf/src/transformers/models/vilt/configuration_vilt.py#L112

Values in both the documentation and the default value should match that of https://huggingface.co/dandelin/vilt-b32-mlm 😉 

The value of dropout in the original implementation by dandelin is 0.1 . Since the value in the docstring is already that, I'm changing the `init` to that and creating a PR.
Potential bug of the Bark implementation
Author: leo19941227
Pull request: no

### System Info

Hello,

I am not sure whether this is a bug, but I notice this suspicious line when tracing the whole implementation of Bark.
It seems the text tokens, prompting semantic tokens, and the continued semantic tokens should be concatenated along the time axis as shown by the official implementation:

https://github.com/suno-ai/bark/blob/cb89688307c28cbd2d8bbfc78e534b9812673a26/bark/generation.py#L439-L443

However in the transformers package it seems like there is a typo:

https://github.com/huggingface/transformers/blob/fb7d246951d5f60aa36a7958841dfea72f51fc6b/src/transformers/models/bark/modeling_bark.py#L779-L786

Ignore me if this is expected in the transformers library's context. I just think it might be helpful if it was not noticed before.

### Who can help?

@ylacombe @sanchit-gandhi

### 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

The example code can work fine, just a minor correctness concern.

### Expected behavior

I expected the code block to be like:

```python3
        input_embeds = torch.cat(
            [
                self.input_embeds_layer(input_ids[:, :max_input_semantic_length]),
                self.input_embeds_layer(semantic_history[:, : max_input_semantic_length]),
                self.input_embeds_layer(infer_array),
            ],
            dim=1,
        )
```

Comments:
Sorry, now I notice the `merge_context` context option during the GPT forward. I have no concern then. Closing the issue.
Add torchaudio with rocm 5.6 to AMD Dockerfile
Author: fxmarty
Pull request: yes

As per title

e.g. `CUDA_VISIBLE_DEVICES=0 pytest tests/models/wav2vec2/test_modeling_wav2vec2.py -s -vvvvv` now do pass.

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

@fxmarty Could you link to any relevant conversation / issue relating to this fix in the PR description? 

@amyeroberts we are enabling transformers CI on AMD GPUs as part of our partnership with them.

I originally started the `huggingface:ci-amdgpu` work under a branch on the official transformers repo but @fxmarty can't do the same.

The PR here is to merge the work Felix has been doing enabling `torchaudio` to build against AMD ROCm instead of CUDA inside my original branch so we can test the workflow end2end with all the modalities.

Hope it clarify a bit what we're trying to achieve here 🙂. We can take it offline if you want some more info 👍🏼.

cc @LysandreJik for viz

@mfuntowicz No, that's OK, thanks for the explanation! I just wanted to know if there were any open issues or additional context needed before reviews happen. 

@ydshieh I think I don't have rights to create / push to a branch on transformers: https://huggingface.slack.com/archives/C014N4749J9/p1693906519779479

Thanks everyone for your feedback, I'm merging now to unlock the remaining on my branch 🤗
[`CITests`] skip failing tests until #26054 is merged
Author: ArthurZucker
Pull request: yes

# What does this PR do?
Simply skips the 3 failing whisper test until @sanchit-gandhi finishes up #26054

Comments:
fyi @amyeroberts and @LysandreJik to have a green weekend 😉 

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_26063). All of your documentation changes will be reflected on that endpoint.
Correct progress bar update step on all files no_runner. Change description of train, validation file of mlm
Author: pphuc25
Pull request: yes

Hi,
as merged in #25324 (adding txt description on train and val of file clm_no_trainer) and #25691 (correct update progress bar of steps). I see that much of file no_trainer is not correct about these, so I made a pull request to correct them.

In the edit:
- I see that some files such as run_translataion_no_trainer are not correct about args.gradient_accumulation_steps name in completed_steps (the original is args.gradient_accumulation_stepp which did not appear before).
- In run_qa_no_trainer, the resume_step is not multiplied with args.gradient_accumulation_steps yet. So I corrected it by multiplying it.

I would like to cc @sgugger to review my PR.

Comments:
cc @muellerzr
🌐 [i18n-KO] Translated `llama2.md` to Korean
Author: mjk0618
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다! -->
# What does this PR do?

Translated the `llama2.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
- [ ] Check for missing / redundant translations (번역 누락/중복 검사)
- [ ] Grammar Check (맞춤법 검사)
- [ ] Review or Add new terms to glossary (용어 확인 및 추가)
- [ ] Check Inline TOC (e.g. `[[lowercased-header]]`)
- [ ] Check live-preview for gotchas (live-preview로 정상작동 확인)

## Who can review? (Initial)

<!-- 1. 위 체크가 모두 완료된 뒤에, 이 아래에 리뷰를 요청할 팀원들을 멘션해주세요! -->
<!-- May you please review this PR? @member1 @member2 ... -->

## 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:
This PR was closed because it contains incorrect commits.
the code in the main readme file isnt working 
Author: akintola4
Pull request: no

### System Info

it brings out this error when i try to run the code for the cat and remote identification .

No model was supplied, defaulted to facebook/detr-resnet-50 and revision 2729413 (https://huggingface.co/facebook/detr-resnet-50).
Using a pipeline without specifying a model name and revision in production is not recommended.
Could not find image processor class in the image processor config or the model config. Loading based on pattern matching with the model's feature extractor configuration.
The `max_size` parameter is deprecated and will be removed in v4.26. Please specify in `size['longest_edge'] instead`.

### Who can help?

@Narsil

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

import requests
from PIL import Image
from transformers import pipeline

# Download an image with cute cats
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/coco_sample.png"
image_data = requests.get(url, stream=True).raw
image = Image.open(image_data)

# Allocate a pipeline for object detection
object_detector = pipeline('object-detection')
object_detector(image)
[{'score': 0.9982201457023621,
  'label': 'remote',
  'box': {'xmin': 40, 'ymin': 70, 'xmax': 175, 'ymax': 117}},
 {'score': 0.9960021376609802,
  'label': 'remote',
  'box': {'xmin': 333, 'ymin': 72, 'xmax': 368, 'ymax': 187}},
 {'score': 0.9954745173454285,
  'label': 'couch',
  'box': {'xmin': 0, 'ymin': 1, 'xmax': 639, 'ymax': 473}},
 {'score': 0.9988006353378296,
  'label': 'cat',
  'box': {'xmin': 13, 'ymin': 52, 'xmax': 314, 'ymax': 470}},
 {'score': 0.9986783862113953,
  'label': 'cat',
  'box': {'xmin': 345, 'ymin': 23, 'xmax': 640, 'ymax': 368}}]

### Expected behavior

it should identify what it was said to do in the readme file

Comments:
It indeed performs its intended function, and the issues you mentioned appear to be merely log messages.

I was expecting it to display a Image like the one in the main Readme file, correct me if am mistaken. this my first time using it, am new to all this.

For that, you have to write a script that would display all the bounding boxes on top of the image, For reference do have a look at [this](https://huggingface.co/docs/datasets/v2.6.1/en/object_detection). Do let me know if there are more related queries 

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.