AttributeError: 'GenerationConfig' object has no attribute 'architectures'
Author: Ccode-lang
Pull request: no

### System Info

- `transformers` version: 4.26.1
- Platform: Windows-10-10.0.19045-SP0
- Python version: 3.10.10
- Huggingface_hub version: 0.12.1
- PyTorch version (GPU?): 1.13.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
- Using distributed or parallel set-up in script?: no

### Who can help?

@ArthurZucker @younesbelkada

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

1. Run the code below:
```python
from transformers import pipeline, set_seed, GenerationConfig

config = GenerationConfig(max_new_tokens=500, temperature=1.2, num_return_sequences=1)
generator = pipeline('text-generation', model='gpt2-xl', device=0, config = config)
```
2. Get this error:
```
Traceback (most recent call last):
  File "C:\Users\Cooper Lynn\gpt\bot.py", line 4, in <module>
    generator = pipeline('text-generation', model='gpt2-xl', device=0, config = config)
  File "C:\Users\Cooper Lynn\gpt\.env\lib\site-packages\transformers\pipelines\__init__.py", line 754, in pipeline
    framework, model = infer_framework_load_model(
  File "C:\Users\Cooper Lynn\gpt\.env\lib\site-packages\transformers\pipelines\base.py", line 224, in infer_framework_load_model
    if config.architectures:
AttributeError: 'GenerationConfig' object has no attribute 'architectures'
```

# Extra info
I can't access the documentation for the `GenerationConfig()` function.

### Expected behavior

No error.

Comments:
Until this is fixed I'll use the decapitated method.

Hello @Ccode-lang 
Thanks for the issue , I think the correct keyword argument here is `generate_config`: 
```python
from transformers import pipeline, set_seed, GenerationConfig

config = GenerationConfig(max_new_tokens=500, temperature=1.2, num_return_sequences=1)
generator = pipeline('text-generation', model='gpt2-xl', device=0, generate_config = config)
generator("Hello")
```
cc @gante in case I missed something

Oh, thanks!  That doesn't show up on the docs so I didn't know about this parameter only `config` showed up.  I'll test this later.

Now I get this error:
```
  warnings.warn(
Traceback (most recent call last):
  File "C:\Users\Cooper Lynn\gpt\bot.py", line 53, in <module>
    in_out()
  File "C:\Users\Cooper Lynn\gpt\bot.py", line 47, in in_out
    response = generator(text)[0]['generated_text'].removeprefix(text).split("\n")[0][1:]
  File "C:\Users\Cooper Lynn\gpt\.env\lib\site-packages\transformers\pipelines\text_generation.py", line 210, in __call__
    return super().__call__(text_inputs, **kwargs)
  File "C:\Users\Cooper Lynn\gpt\.env\lib\site-packages\transformers\pipelines\base.py", line 1084, in __call__
    return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)
  File "C:\Users\Cooper Lynn\gpt\.env\lib\site-packages\transformers\pipelines\base.py", line 1091, in run_single
    model_outputs = self.forward(model_inputs, **forward_params)
  File "C:\Users\Cooper Lynn\gpt\.env\lib\site-packages\transformers\pipelines\base.py", line 992, in forward
    model_outputs = self._forward(model_inputs, **forward_params)
  File "C:\Users\Cooper Lynn\gpt\.env\lib\site-packages\transformers\pipelines\text_generation.py", line 252, in _forward
    generated_sequence = self.model.generate(input_ids=input_ids, attention_mask=attention_mask, **generate_kwargs)
  File "C:\Users\Cooper Lynn\gpt\.env\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\Cooper Lynn\gpt\.env\lib\site-packages\transformers\generation\utils.py", line 1197, in generate
    self._validate_model_kwargs(model_kwargs.copy())
  File "C:\Users\Cooper Lynn\gpt\.env\lib\site-packages\transformers\generation\utils.py", line 1090, in _validate_model_kwargs
    raise ValueError(
ValueError: The following `model_kwargs` are not used by the model: ['generate_config'] (note: typos in the generate arguments will also show up in this list)
```


I'm going to guess this is because I am using GPT-2?

Hey all -- the actual keyword for the argument is `generation_config`, and not `generate_config` :)

`pipeline()` accepts any argument that `.generate()` does

Oh ok, thanks!  I'm going to fix this once and for all now :rofl: 


Ok that works, thanks for all of your help.