Error:  Both `max_new_tokens` and `max_length` have been set but they serve the same purpose
Author: arastumudgal
Pull request: no

### System Info

- `transformers` version: 4.26.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.12.0
- PyTorch version (GPU?): 1.13.1+cu116 (False)
- Tensorflow version (GPU?): 2.9.2 (False)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed

### Who can help?

@gante @ArthurZucker @younesbelkada @sgugger @stevhliu @MKhalusova 

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

I was setting up and using Galactica language model. 
Was facing this error: 
**ValueError: Both `max_new_tokens` and `max_length` have been set but they serve the same purpose -- setting a limit to the generated output length. Remove one of those arguments. Please refer to the documentation for more information.** 

```
!pip install galai
import galai as gal
from galai.notebook_utils import *
```

`model = gal.load_model("base")
`
`model.generate("The Transformer architecture [START_REF]") ` ----- here the error came up.


Same error came up while running this ---- 
```
prompt = f"Question: A bat and a ball cost $\\$1.10$ in total. The bat costs $\\$1.00$ more than the ball. How much does the ball cost?\n\nAnswer:"
display_markdown(model.generate(prompt, new_doc=True, max_length=250))
```

### Expected behavior

<img width="1179" alt="Screenshot 2023-02-02 at 9 37 50 AM" src="https://user-images.githubusercontent.com/76526750/216229408-a68fb60b-0c50-4fe9-877a-d0cac693ca46.png">
<img width="1167" alt="Screenshot 2023-02-02 at 9 38 00 AM" src="https://user-images.githubusercontent.com/76526750/216229415-f8d4f67f-8e23-4937-a57e-967c3f37357f.png">


these are the expected results. Please help.

Comments:
Hi @arastumudgal 
If I am not mistaken, the fix should have been addressed in https://github.com/huggingface/transformers/pull/21347
If you install `transformers` from the `main` branch `pip install git+https://github.com/huggingface/transformers`, your script should work


Hi @younesbelkada 

`
ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html`


I am facing this error on jupyter notebook when loading the models.
<img width="582" alt="Screenshot 2023-02-07 at 9 04 04 AM" src="https://user-images.githubusercontent.com/76526750/217141786-2dc0da11-5a16-42c0-9924-e029fe56abe1.png">


```
!pip install -U ipywidgets
!pip install ipywidgets --upgrade
!jupyter nbextension enable --py widgetsnbextension
!pip install -U jupyter
```


Did this too but still it isnt working, showing the same error. Any fix? It is working on google colab but not on jupyter notebook. 

Hi @arastumudgal 
Thanks for the issue but this looks like an issue that is independent from `transformers` 

> Hi @arastumudgal If I am not mistaken, the fix should have been addressed in #21347 If you install `transformers` from the `main` branch `pip install git+https://github.com/huggingface/transformers`, your script should work



Just tried this, facing the same error though. @younesbelkada 

@arastumudgal Maybe an update flag was missing, i.e. `pip install -U git+https://github.com/huggingface/transformers` :) 

Please note that `galai` [has a pinned transformers version](https://github.com/paperswithcode/galai/blob/e3e34481aefeceff9f239f2121988566382a72b2/requirements.txt#L2), and you might run into other issues.

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.