noamaanMulla-03/transformers-issues huggingface dataset:
Add MAEST (Music Audio Efficient Spectrogram Transformer) model
Author: palonso
Pull request: yes

# What does this PR do?
This PR implements the MAEST models (based on AST) as proposed in #26491.


## 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. 

Given that MAEST is intended for music applications and is audio-based, I consider that @sanchit-gandhi could be the appropriate member for having a look at it.

Thank you very much for considering this PR!



Comments:
Setting this PR as a draft, for now, since several tests are not passing locally on `test_modeling_maest.py`. Similarly, I found that the same tests are not passing for `test_modeling_audio_spectrogram_transformer`.py, so I'll need to investigate 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 tokenizer truncation 
Author: ranchlai
Pull request: yes

# This PR fixes a tokenizer truncation bug.

Setting max_length=0 or 1 leads to the following problem that should be fixed: 

```python
from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat-hf", use_fast=False)
text = "hello world hello world"
tokens = tokenizer(text, max_length=1, truncation=True, add_special_tokens=True)
print("tokens: ", tokens)


>>> [ERROR|/root/data/code/transformers/src/transformers/tokenization_utils_base.py:3468] 2023-09-17 13:08:29,020 >> >>> We need to remove 4 to truncate the input but the first sequence has a length 4. 
>>> tokens:  {'input_ids': [1, 22172, 3186, 22172, 3186], 'attention_mask': [1, 1, 1, 1, 1]}
```

This PR also make the length of tokens in consistent with fast-tokenizer. 

Also added unit-test for this fix. 




Comments:
Hi, @ArthurZucker Sorry for late reply. 

Please check the following code if you could.  For`"meta-llama/Llama-2-7b-chat-hf"`  , this PR makes slow tokenizer the same as fast version.  The fast version is "more correct" as it truncates to 1 as requested.

But for `bert-base-cased`, fast and slow are the same, failing to do the truncation. If I make the slow version do the truncation, it will be different from the fast version.

Maybe `max_lenght`<=2  is not a very interesting case. 

```python

from transformers import AutoTokenizer

name = "meta-llama/Llama-2-7b-chat-hf"
text = "Example to test truncation"
tokenizer = AutoTokenizer.from_pretrained(name, use_fast=False)
tokenizer_fast = AutoTokenizer.from_pretrained(name, use_fast=True)

p = tokenizer(text, max_length=1, truncation=True, add_special_tokens=True)
print(p)
# {'input_ids': [1, 8741, 304, 1243, 21022, 362], 'attention_mask': [1, 1, 1, 1, 1, 1]}

t = tokenizer_fast(text, max_length=1, truncation=True, add_special_tokens=True)
print(t)
# {'input_ids': [1], 'attention_mask': [1]}

name = "bert-base-cased"
tokenizer = AutoTokenizer.from_pretrained(name, use_fast=False)
tokenizer_fast = AutoTokenizer.from_pretrained(name, use_fast=True)

p = tokenizer(text, max_length=1, truncation=True, add_special_tokens=True)
print(p)
# {'input_ids': [101, 16409, 26671, 1106, 2774, 189, 10607, 14520, 102], 'token_type_ids': [0, 0, 0, 0, 0, 0, 0, 0, 0], 'attention_mask': [1, 1, 1, 1, 1, 1, 1, 1, 1]}
t = tokenizer_fast(text, max_length=1, truncation=True, add_special_tokens=True)
print(t)
# {'input_ids': [101, 16409, 26671, 1106, 2774, 189, 10607, 14520, 102], 'token_type_ids': [0, 0, 0, 0, 0, 0, 0, 0, 0], 'attention_mask': [1, 1, 1, 1, 1, 1, 1, 1, 1]}
```



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.
Luke Finetuning Error
Author: luffycodes
Pull request: no
Labels: name: bug

### System Info

- `transformers` version: 4.21.2
- Platform: Linux-4.15.0-192-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.13
- Huggingface_hub version: 0.9.1
- PyTorch version (GPU?): 1.7.1 (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 @jplu

Hi, I was running the finetuning script for LUKE: [Link](https://github.com/huggingface/transformers/blob/main/examples/research_projects/luke/run_luke_ner_no_trainer.py).

I ran into this weird issue:
forward() got an unexpected keyword argument 'ner_tags'

Also, any idea as to what's the f1 score for ner task using this script?

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

`CUDA_VISIBLE_DEVICES=0 python run_luke_ner_no_trainer.py   --model_name_or_path studio-ousia/luke-base   --dataset_name conll2003   --task_name ner  --max_length 128   --per_device_train_batch_size 32   --learning_rate 2e-5   --num_train_epochs 3   --output_dir NER`

### Expected behavior

Starts the training process.

Comments:
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

Hi!
I also experienced this error. @luffycodes could you eventually make it work?
AWQ model error when `AwqConfig['version']` is a string
Author: poedator
Pull request: no

### System Info

A100 Cuda 12.2 transformers 4.36.0.dev (Nov4)

### Who can help?

@younesbelkada @SunMarc 

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

load some AWQ model, like `"marcsun13/Llama-2-13B-AWQ"` - it has  `AwqConfig['version']` as a string "GEMM".
later in `utils/quantization.config.py::AWQcofig.post_init` there is this check:
```
        if self.version not in [AWQLinearVersion.GEMM, AWQLinearVersion.GEMV]:
            raise ValueError(
                f"Only supported versions are in [AWQLinearVersion.GEMM, AWQLinearVersion.GEMV] - not recognized version {self.version}"
            )
```
Apparently it fails because `version` is still a string "GEMM"

please consider some string -> enum conversion during init or rewrite this check when loading model.

### Expected behavior

normal model loading.

Comments:
Hi the normal Cuda load as seen below

**from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

tokenizer = AutoTokenizer.from_pretrained("quant_autoawq")
model = AutoModelForCausalLM.from_pretrained("quant_autoawq",  device_map="cuda:0")****

is taking up too much GPU memory

It doesn't work like Auto AWQ  package as seen below.  

**from awq import AutoAWQForCausalLM
from transformers import AutoTokenizer, TextStreamer

tokenizer = AutoTokenizer.from_pretrained("quant_autoawq", trust_remote_code=True)
model = AutoAWQForCausalLM.from_quantized("quant_autoawq", fuse_layers=True)**


What parameters do we need to pass ?

Thanks


Hi @choochtech thanks for your message, would you mind posting a new ticket for your issue? it seems unrelated to the issue posted by @poedator !


@younesbelkada  thanks
cannot recall the model after registering it using AutoModelForCausalLM.register
Author: Ranitbag007
Pull request: no
Labels: name: New model

### Model description

 I have registered my custom model using AutoModelForCausalLM.register(CustomAIConfig, CustomAI) but I am unable to call the model . It shows ImportError: cannot import name 'CustomAI' from 'transformers' (/usr/local/lib/python3.10/dist-packages/transformers/init.py) . Can you help me in this?

### Open source status

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

### Provide useful links for the implementation

_No response_

Comments:
Hi @Ranitbag007, thanks for raising an issue. 

Could you follow the issue template for [reporting a bug](https://github.com/huggingface/transformers/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml)? It should include: 
* The running environment: run `transformers-cli env` in the terminal and copy-paste the output
* Full details of the bug: full traceback of the error
* Code we can use to reproduce the error

In this case, if you're trying to register a custom model, I suggest adding the model on the hub and linking to that repo so that we can inspect.
update Bark FA2 docs
Author: ylacombe
Pull request: yes

# What does this PR do?

Following @ArthurZucker's [review](https://github.com/huggingface/transformers/pull/27364#pullrequestreview-1722408067) in #27634, I've added a section on FA2 in Bark readme and a mention of Bark FA2 support in a section on FA2! 

Note that this comment https://github.com/huggingface/transformers/pull/27364#discussion_r1387923555 is already addressed since `self.dropout` is already a float!

## Before submitting
- [w] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).

cc @amyeroberts and @ArthurZucker 

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

Thanks! Merging!
Add ReCag model
Author: Ranitbag007
Pull request: no
Labels: name: New model

### Model description

Want to add a new model ReCag in Transformers.

### Open source status

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

### Provide useful links for the implementation

_No response_

Comments:
Hi @Ranitbag007, thanks for opening this new model request! 

Could you update the issue description to include any relevant links to the model, such as the paper and any relevant repos?

We have recently been trying to push for `model on the hub` and have as much support as we can there. It will also be easier to integrate it! For anyone which wishes to tackle adding this model - here is a [tutorial](https://huggingface.co/docs/transformers/custom_models). 

I have built a model architecture and tokenizer  using sentencepiece . I want to integrate the model to Huggingface . for further training and implemetntation.

@Ranitbag007 - that's great! This means there isn't much work at all to be able to make the model usable in the transformers library. The tutorial on [adding custom models](https://huggingface.co/docs/transformers/custom_models) should contain all necessary information on how to add the model to the hub. Let us know if anything isn't clear or you need help! 

Hi. https://github.com/Ranitbag007/Recag this is the code for tokenizer and model architecture can you help me to add this model into huggingface?


@amyeroberts 

@Ranitbag007 - the [linked to tutorial](https://huggingface.co/docs/transformers/custom_models) should tell you all the steps needed for adding the model to the hub. Here is a more general overview of adding models to transformers: https://huggingface.co/docs/transformers/v4.35.0/en/add_new_model - note in this case you don't need to open a PR in this library, instead you can create a model repo and add the code there directly on the hub!

Do I need to occur qany changement in my codes?


@amyeroberts I have  registered my custom model using AutoModelForCausalLM.register(CustomAIConfig, CustomAI) but I am unable to call the model . It shows ImportError: cannot import name 'CustomAI' from 'transformers' (/usr/local/lib/python3.10/dist-packages/transformers/__init__.py) . Can you help me in this?

Without seeing the modeling code I won't be able to help - could you link to it on its repo on the hub?
remove failing tests and clean FE files
Author: ylacombe
Pull request: yes

# What does this PR do?

Fixes [this](https://app.circleci.com/pipelines/github/huggingface/transformers/77846/workflows/8ed051fc-a105-462e-9097-91e919374c6e/jobs/992100), which was introduced by #26339.

To explain a bit, in #26339 I've mutualised an overriding of `to_dict` which deleted `mel_filters` and `windows`. The failing test was testing to retrieve those parameters to assert equality.

I've also cleaned a bit feature extractors that overrode `to_dict`.


Comments:
Could you run the feature extraction tests for all the audio models to double check they're passing before merging please! 

Sure thing!

I've double check every audio models! Everything passes

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

Cool - do you have permissions to merge? I can merge if not 

I do, it's merged!
At most 2 GPUs for CI
Author: ydshieh
Pull request: yes

# What does this PR do?

We now switch our CI runners from GCP to AWS, and on AWS, we can only config single gpu VMs or 4 gpus VMs (with all the condition we impose).

However, our tests don't like env. with 4 GPUs, and there are > 50 more failing tests on the report.

Considering we use 2 GPUs for multi-gpu testing for years, this PR allow the CI to run only with 2 GPUs at the workflow level, even if the hardware have 4 GPUs.

(If we should check with 4 GPUs is another question, but I am afraid we don't have enough bandwidth so far).

Comments:
_The documentation is not available anymore as the PR was closed or merged._
[New model] Phi-1 and Phi-1_5
Author: xenova
Pull request: no
Labels: name: New model

### Model description

From their respective model cards,

phi-1:

> The language model phi-1 is a Transformer with 1.3 billion parameters, specialized for basic Python coding. Its training involved a variety of data sources, including subsets of Python codes from [The Stack v1.2](https://huggingface.co/datasets/bigcode/the-stack), Q&A content from [StackOverflow](https://archive.org/download/stackexchange), competition code from [code_contests](https://github.com/deepmind/code_contests), and synthetic Python textbooks and exercises generated by [gpt-3.5-turbo-0301](https://platform.openai.com/docs/models/gpt-3-5). Even though the model and the datasets are relatively small compared to contemporary Large Language Models (LLMs), phi-1 has demonstrated an impressive accuracy rate exceeding 50% on the simple Python coding benchmark, HumanEval.

phi-1_5:
> The language model phi-1.5 is a Transformer with 1.3 billion parameters. It was trained using the same data sources as [phi-1](https://huggingface.co/microsoft/phi-1), augmented with a new data source that consists of various NLP synthetic texts. When assessed against benchmarks testing common sense, language understanding, and logical reasoning, phi-1.5 demonstrates a nearly state-of-the-art performance among models with less than 10 billion parameters.
>
> We did not fine-tune phi-1.5 either for instruction following or through reinforcement learning from human feedback. The intention behind crafting this open-source model is to provide the research community with a non-restricted small model to explore vital safety challenges, such as reducing toxicity, understanding societal biases, enhancing controllability, and more.


Benchmarks for the 1.5 model (from their [paper](https://arxiv.org/pdf/2309.05463.pdf)) indicate better (or on-par) performance with llama and llama2 models, especially on multi-step reasoning.
![image](https://github.com/huggingface/transformers/assets/26504141/eae8a6ae-62cf-4d17-ad55-a7ec4222afa5)


### Open source status

- [X] The model implementation is available
- [X] The model weights are available

### Provide useful links for the implementation


### Phi-1
Paper: https://arxiv.org/abs/2306.11644

Model + code: https://huggingface.co/microsoft/phi-1

### Phi-1_5

Paper: https://arxiv.org/abs/2309.05463

Model + code: https://huggingface.co/microsoft/phi-1_5


Comments:
Hi @xenova , are you contributing this model(s)? If not, can I please take this issue?

@susnato I just made the request, so feel free to take it! 🤗
Make `examples_torch_job` faster
Author: ydshieh
Pull request: yes

# What does this PR do?

This job sometimes having some test timeout (> 120s.). Even if job passes, the log looks like
```
115.55s call     examples/pytorch/test_pytorch_examples.py::ExamplesTests::test_run_semantic_segmentation
66.07s call     examples/pytorch/test_pytorch_examples.py::ExamplesTests::test_run_squad
48.24s call     examples/pytorch/test_pytorch_examples.py::ExamplesTests::test_run_speech_recognition_seq2seq
```

It turns out that setting `OMP_NUM_THREADS=1` has a huge impact on this job. 

This PR sets `OMP_NUM_THREADS=8` to make it run faster. It now looks like 
```
25.78s call     examples/pytorch/test_pytorch_examples.py::ExamplesTests::test_run_semantic_segmentation
22.82s call     examples/pytorch/test_accelerate_examples.py::ExamplesTestsNoTrainer::test_run_swag_no_trainer
20.69s call     examples/pytorch/test_pytorch_examples.py::ExamplesTests::test_run_speech_recognition_seq2seq
```

Note that setting `OMP_NUM_THREADS>1` with `pytest -n` where `n > 1` is going to break things (timeout, blocked etc.).



Comments:
_The documentation is not available anymore as the PR was closed or merged._
FIXED POSITION OF NAVBAR 
Author: kiranugale2o
Pull request: no

### Feature request

FIXED POSITION OF NAVBAR 
![Oh My Zsh - a delightful   open source framework for Zsh and 5 more pages - Personal - Microsoft​ Edge 03-10-2023 19_48_08](https://github.com/huggingface/transformers/assets/141510294/a8537122-78a4-4bf6-b84a-cdee12b2aa1d)
![Oh My Zsh - a delightful   open source framework for Zsh and 5 more pages - Personal - Microsoft​ Edge 03-10-2023 19_48_17](https://github.com/huggingface/transformers/assets/141510294/e62fd861-9077-4290-946e-2df9f19a3af7)


### Motivation

FIXED POSITION OF NAVBAR 

### Your contribution

FIXED POSITION OF NAVBAR 

Comments:
I would Like to take this issue.

@kiranugale2o can please assign this issue to me ?

Might be of interest to @mishig25 

i am not working on this anymore, @iamadisinghal would be a better choice for this issue

Could you elaborate on what do you mean by "Fixed position in navbar"?

> Could you elaborate on what do you mean by "Fixed position in navbar"?

Set Navbar position to 
position:fixed;

> @kiranugale2o can please assign this issue to me ?

Yes

Could you please assign this to me? I would love to work 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.
AttributeError: module 'bitsandbytes.nn' has no attribute 'Linear8bitLt'
Author: priyaray21
Pull request: no

### System Info

transformers==4.33.3
python 3.10
azureml-mlflow==1.53.0

### Who can help?

 Hi,
@ArthurZucker , @younesbelkada and @sanchit-gandhi

When I am trying to run GPTQ family models, throwing AttributeError: module 'bitsandbytes.nn' has no attribute 'Linear8bitLt'

<img width="408" alt="image" src="https://github.com/huggingface/transformers/assets/139554535/8e9a8708-dfe1-43cc-9fc8-eec036d83b7d">


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

I have installed bitsandbytes-cuda111 but getting Attribute Errors.

### Expected behavior

How can I fix that issue?

Comments:
Hi @priyaray21 
Thanks for the issue, this sounds like an issue with peft, can you try to uninstall `bitsandbytes-cuda111` as it is an old version of the lib and install `bitsandbytes` instead?

```bash
pip uninstall bitsandbytes-cuda11
pip install -U bitsandbytes
```

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.
Create motion-detection.py
Author: mdazfar2
Pull request: yes

@LysandreJik done i will upload the code according to your request if you like feel free to ask anything

Comments:
Hey @mdazfar2 I'm not sure I asked for this? In which issue was this mentioned?

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.