noamaanMulla-03/transformers-issues huggingface dataset:
[DPT, Dinov2] Add resources
Author: NielsRogge
Pull request: yes

# What does this PR do?

To make more people aware that DPT is now compatible with `AutoBackbone` (https://github.com/huggingface/transformers/pull/26092), I've added some usage tips and resources to the docs.

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

@NielsRogge Shall I merge?

Yes this can be merged :)
Update tiny model summary file
Author: ydshieh
Pull request: yes

# What does this PR do?

Update tiny model summary file (to enable pipeline testing for recently added models).

----------------------------------------------------------------------------------------------

The following is a more detailed step on how to do this update (as a reference for the )

#### Steps

1. Go to https://github.com/huggingface/transformers/actions/workflows/check_tiny_models.yml -> Click the latest successful run -> Download the artifact `tiny_model_creation_reports ` -> Open the file `updated_tiny_model_summary.json` in the artifact and copy the content

2. Paste the content copied in step 1. to `tests/utils/tiny_model_summary.json` 

    - 2.1. Check the diff: if some architectures only get tokenizer/processor being created? if some recently added architectures in `transformers` not showing, etc. If so, we will need to check if we could do something. 
    - 2.2. Once the changes look good, commit it.

3. Update the mapping
  - 3.1 `python utils\add_pipeline_model_mapping_to_test.py --all --overwrite`
  - 3.2 `ruff format examples tests src utils setup.py conftest.py`
  - 3.3 `ruff check examples tests src utils setup.py conftest.py --fix` 
  - 3.4 Commit the changes

4. 

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

**Ignore this comment 🙏** 

```
(py38) λ ruff check examples tests src utils setup.py conftest.py --fix
tests\models\clvp\test_modeling_clvp.py:284:64: F821 Undefined name `PipelineTesterMixin`
tests\models\dpt\test_modeling_dpt_auto_backbone.py:143:35: F821 Undefined name `DPTModel`
tests\models\dpt\test_modeling_dpt_auto_backbone.py:144:35: F821 Undefined name `DPTForSemanticSegmentation`
tests\models\esm\test_modeling_esmfold.py:176:35: F821 Undefined name `EsmModel`
tests\models\esm\test_modeling_esmfold.py:177:26: F821 Undefined name `EsmForMaskedLM`
tests\models\esm\test_modeling_esmfold.py:178:36: F821 Undefined name `EsmForSequenceClassification`
tests\models\esm\test_modeling_esmfold.py:179:37: F821 Undefined name `EsmForTokenClassification`
tests\models\esm\test_modeling_esmfold.py:180:26: F821 Undefined name `EsmForSequenceClassification`
tests\models\fuyu\test_modeling_fuyu.py:265:39: F821 Undefined name `PipelineTesterMixin`
tests\models\kosmos2\test_modeling_kosmos2.py:247:42: F821 Undefined name `PipelineTesterMixin`
tests\models\seamless_m4t\test_modeling_seamless_m4t.py:620:46: F821 Undefined name `PipelineTesterMixin`
Found 11 errors.
```

check dpt, permission and esmfold
check TFLayoutLMv3ForQuestionAnswering
difference in tokenization - bert-base-multilingual-cased vs uncased
Author: dsplog
Pull request: no

### System Info

- `transformers` version: 4.33.3
- Platform: Linux-5.15.0-88-generic-x86_64-with-glibc2.17
- Python version: 3.8.18
- Huggingface_hub version: 0.17.3
- Safetensors version: 0.4.0
- Accelerate version: 0.23.0
- Accelerate config: 	not found
- PyTorch version (GPU?): 2.1.0+cu121 (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?: no
- Using distributed or parallel set-up in script?: no


### Who can help?

_No response_

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

```
>>> text = 'hello my dear'
>>> 
>>> from transformers import BertTokenizer
>>> bert_c_tok = BertTokenizer.from_pretrained('bert-base-multilingual-cased')
>>> 
>>> enc_c_tok =  bert_c_tok.encode(text)
>>> print([bert_c_tok.decode([x]) for x in enc_c_tok])
['[CLS]', 'hell', '##o', 'my', 'dea', '##r', '[SEP]']
>>> 
>>> bert_unc_tok = BertTokenizer.from_pretrained('bert-base-multilingual-uncased')

>>> enc_unc_tok =  bert_unc_tok.encode(text)
>>> print([bert_unc_tok.decode([x]) for x in enc_unc_tok])
['[CLS]', 'hello', 'my', 'dear', '[SEP]']

```

### Expected behavior

was not expecting bert cased tokenization splitting "hello" as "hell" and "##o"

Comments:
Hey 🤗 
1. If you want to know the actual tokenization you should be using:
```python
>>> text = 'hello my dear'
>>> 
>>> from transformers import BertTokenizer
>>> bert_c_tok = BertTokenizer.from_pretrained('bert-base-multilingual-cased')
>>> bert_c_tok.tokenize(text)
['hell', '##o', 'my', 'dea', '##r']
```
2. These two tokenizers are different. Their pre-processing are different thus the tokens they produce during training do not have the same distribution. This means for example that `Hello` and `hello` are the same for the uncased model, thus they are more frequent, and thus not split into different tokens! 

ah, thanks for the clarification. will do some reading to understand the pre-processing fine prints. if you have any links to share, it will be helpful.
Seeking Guidance on Using Codecov to Transformers Repository
Author: yunbolyu
Pull request: no

### Feature request

Hello Transformers maintainers and community,

In an effort to use the Codecov module and obtain code coverage, I attempted to base my changes on the previous removal process. However, I've encountered challenges since the tests appear to have been divided into multiple segments [PR #7970](https://github.com/huggingface/transformers/pull/7970). I also came across [PR #8093](https://github.com/huggingface/transformers/pull/8093), which suggests merging two slow tests (TF and PT) for coverage. While this seems to be a lead, I'm uncertain about the actual implementation.

### Motivation

I am currently conducting an empirical study focusing on code coverage in deep-learning open-source projects. While trying to use Codecov for assessing the code coverage of Transformers, I observed that Codecov was previously utilized by the project. However, as per [PR #7970](https://github.com/huggingface/transformers/pull/7970), due to the workflow refactoring and the diminishing utility of Codecov reports, the Codecov module was removed.

### Your contribution

Could anyone provide insights or suggestions on how best to use Codecov and achieve correct code coverage for Transformers?

Thank you in advance for your assistance and guidance.

Comments:
Pinging @LysandreJik as he was here during the good old times when Codecov was used!

Thanks for pinging out. I've seen him a lot in previous discussions and appreciate his ongoing contributions to the open-source community and your timely response!

Hey @yunbolyu! Setting up codecov right now for transformers would likely be a significant engineering endeavor given the different flavors of tests that we support. We rarely run the entire test suite at once on all supported hardware, so making sense of the different workflows would likely be tough for codecov.

@ydshieh, who's managing our testing infra can probably share a bit more than I can.

Hi @yunbolyu As Lysandre said, the CI only runs a subset of tests (and would be different subsets in each run, except for the nightly CI run). Furthermore,  I never used `Codecov` before and don't have useful insights to help you.

A quick look tell me we need the following (but I think you know this already) in each CircleCI job

```
run: pip install codecov pytest-cov
run: pytest ... `--cov`
run: codecov  
```
But I don't know what problems you encountered here. If you mean multiple reports presented, it's probably better to treat them as different CI and report them (well, this probably doesn't make sense...), or you will have to manually to merge those reports.



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 typo in warning message
Author: liuxueyang
Pull request: yes

Fix a typo in the warning message. The value of `default_cache_path` is `~/.cache/huggingface/hub` not `~/.cache/huggingface/transformers`.

v4.22.0 is the earlist version that contains those changes in PR https://github.com/huggingface/transformers/pull/18492


Comments:
It's not a typo. I guess this is a missing change in the PR #18492 

Already rebased and CI passed.

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.

Sorry for the delay I'll merge 😉 

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_27055). All of your documentation changes will be reflected on that endpoint.
Fix semantic error in evaluation section
Author: anihm136
Pull request: yes

# What does this PR do?

Change "convert predictions to logits" to "convert logits to
predictions" to fix semantic error in the evaluation section. Logits
need to be converted to predictions to evaluate the accuracy, not the
other way round

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

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.
cc: @stevehliu


Comments:
Docs/Add conversion code to the musicgen docs
Author: yoinked-h
Pull request: yes


# What does this PR do?

Adds conversion code to the musicgen docs (the conversion code is quite hidden and needs some changes to be run on other model dirs)

## 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?

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.

@sanchit-gandhi 



Comments:
Hey! Updated the people you pinged, let's minimize it 😉 

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_27665). All of your documentation changes will be reflected on that endpoint.
[`DocString`] Support a revision in the docstring `add_code_sample_docstrings` to facilitate integrations
Author: ArthurZucker
Pull request: yes

# What does this PR do?
When PRs on the hub are not merged yet + sometimes for safety reasons we can pin a revision in the docstring code samples added. 

Seems like the CI is enough to test, dummy testing the build with a flax t5 model 😉 

Example: https://moon-ci-docs.huggingface.co/docs/transformers/pr_27645/en/model_doc/albert#transformers.FlaxAlbertForMaskedLM.__call__.example 

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

Thanks for the review but a PR in draft mode means it's a draft 😉 

oh no :sweat: missed the draft status somehow

No worries 🤗
Reflect RoCm support in the documentation
Author: fxmarty
Pull request: yes

As per title.

We will need https://github.com/huggingface/optimum/pull/1546 to be merged first, and an Optimum release.

Comments:
We may want to update https://huggingface.co/docs/transformers/perf_hardware as well, explaining `rocm-smi --showtopoweight` and `rocm-smi --shownodesbw` output.

@LysandreJik @ArthurZucker @amyeroberts WDYT?

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

Thanks @ArthurZucker that would indeed be a great addition showcasing the variety of hardware supported by Transformers (or extensions of transformers / other community libraries). I'll leave it for an other PR!
ZeroDivisionError in NotebookProgressBar
Author: pete88b
Pull request: no

### System Info


- `transformers` version: 4.35.1
- Platform: Windows-10-10.0.19041-SP0
- Python version: 3.9.0
- Huggingface_hub version: 0.17.3
- Safetensors version: 0.3.1
- Accelerate version: 0.20.3
- Accelerate config:    not found
- 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?: yes (GeForce 3080 laptop)
- Using distributed or parallel set-up in script?: no

### Who can help?

Hi @muellerzr - hope this is an easy one for you (o:

I'm sometimes seeing a divide by zero error when NotebookProgressBar updates.

I've suggested changes to `transformers/utils/notebook.py` in [my notebook](https://github.com/pete88b/spelling-mistake-maker/blob/main/tmp/NotebookProgressBar_divide_by_zero_issue.ipynb).

I'm guessing that for a change this simple, it'll be easier for you to make the change - but please let me know if you prefer I make a PR for this change

### Information

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

Please see [my notebook](https://github.com/pete88b/spelling-mistake-maker/blob/main/tmp/NotebookProgressBar_divide_by_zero_issue.ipynb)

### Expected behavior

We should not get a divide by zero error when `average_time_per_item` is zero

Comments:
Hi @pete88b please feel free to open a PR and ping me for review! 

Hi @hi-sushanta #27524 fixes `update` but misses the fix to `self.label += f", {1/self.average_time_per_item:.2f} it/s"` in `update_bar` - there's more detail in the linked notebook in case it helps.
if it's not too late, could you update your PR to include both (o:

Thank you, Peter🤗.
I updated my code similar to you did.
Successfully Resolved The ZeroDivisionError Exception.
Author: hisushanta
Pull request: yes

I noticed an issue in the issue section and addressed it by adding a small code snippet.

Fixes #27513 


## 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).
- [ ] Did you write any new necessary tests?




Comments:
I'm always looking for ways to improve my code, so please don't hesitate to share your thoughts.

@hi-sushanta It all looks good to me! I can see there's an error on the documentation build unrelated to this PR. Last week there was a fix pushed to `main`. Could you rebase to include that and trigger another CI run? Once all green we should be good to merge! 

@hi-sushanta I think the quality failures are coming from some recent changes to our formatting in the library: we've recently started using `ruff` instead of black. To align with the updates you'll need to: 
* Uninstall black: `pip uninstall black` 
* Install any needed updates: `pip install -e .[quality]`
* Re-run formatting: `make fixup`

now all checked pass.
Trainer removes columns before transform is called
Author: davidgilbertson
Pull request: no

### System Info

- `transformers` version: 4.26.1
- Platform: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31
- Python version: 3.10.8
- Huggingface_hub version: 0.12.1
- PyTorch version (GPU?): 1.13.1+cu116 (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?: yes
- Using distributed or parallel set-up in script?: no

### Who can help?

@sgugger

### Information

- [ ] The official example scripts
- [X] 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 have a text dataset and am attempting to apply a transform to tokenize the contents. I'm using: [with_transform()](https://huggingface.co/docs/datasets/v2.10.0/en/package_reference/main_classes#datasets.Dataset.with_transform) for this and it works fine: the transform removes the `text` column and adds the `input_ids` and `attention_mask` columns.

The problem is when combining this with the `Trainer`, it runs `_remove_unused_columns()` _before_ calling the transform, which has the effect of removing the whole dataset, and I get an error as it tries to read the first batch:
```
IndexError: Invalid key: 664 is out of bounds for size 0
```

### Expected behavior

I should be able to combine `Dataset.with_transform()` and `Trainer`.

Comments:
Ah, I've re-read through the parameter lists for everything and found `remove_unused_columns=False` in `TrainingArguments`. Setting this resolves the issue, so I guess this won't be considered a bug. I think there's room for improvement in the UX though, perhaps a warning "After removing unused columns, there were no columns left, this is probably not what you meant to do, right?"

Like `if set(dataset.column_names) == set(ignored_columns)`...


We could add such a warning yes. Do you want to take a stab at a PR?

Sorry, I've got a full plate at the moment.

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.


> We could add such a warning yes. Do you want to take a stab at a PR?

Just ran into this issue, would like to create a PR for creating a warning about no columns being left during the `_remove_unused_columns()` call
Consider Adding Practical Usage Examples from Issue comment  #8771 to Documentation
Author: rajveer43
Pull request: no

I was going though the documentation of the file path `docs/source/jen/main_classes/deepspeed.md` and this line 

https://github.com/huggingface/transformers/blob/4b423e607455a7aca1edc4beaa713da58e78ef0b/docs/source/en/main_classes/deepspeed.md?plain=1#L206

 and saw below comment in documentation

`For some practical usage examples, please, see this [post](https://github.com/huggingface/transformers/issues/8771#issuecomment-759248400).`

https://github.com/huggingface/transformers/issues/8771#issuecomment-759248400

so I was wondering if we add those examples in a file or as tutorial.

PS. I did not check if this issue exists or any solution made. thank you for your patience.



Comments:
I think we can keep it as is

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.
[WIP] Add HTDemucs
Author: sanchit-gandhi
Pull request: yes

# What does this PR do?

Adds HTDemucs, required for the MusicGen melody model.

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25660). 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.

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.
Logo
Author: IfeanyiEkperi
Pull request: no

### Feature request

Hugging face needs a facelift... A logo that is versatile and can accommodate all of their beaches with minimal change....

I'm proposing a fun logo just as the names. If I'm given a go ahead, I can create one asap

### Motivation

I want to make tech logos around the world look awesome 

### Your contribution

To design a versatile and suitable LOGO for HUGGING FACE and incorporate all its sub-brands like Transformers as well...

Which means, I'll be creating one central logo and several logos for the sub-brands

Comments:
Sounds good but we already have a logo: 🤗 

Okay. I was thinking we could give it a facelift and make it more responsive.

Buy, No problem if it's not needed at this time.

Thank you.

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.