Generate with Logits Processor not working - even with no modifications to logits
Author: SamSJackson
Pull request: no

### System Info

- `transformers` version: 4.37.0.dev0
- Platform: Windows-10-10.0.19045-SP0
- Python version: 3.11.5
- Huggingface_hub version: 0.20.2
- Safetensors version: 0.4.0
- Accelerate version: 0.25.0
- Accelerate config:    not found
- PyTorch version (GPU?): 2.1.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?: Not that I am aware of. 

### 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, ...)
- [X] My own task or dataset (give details below)

### Reproduction

# Overview
I am using a custom logits processor but I have made a custom class here that does nothing to the logits but shows that the process is not working.

Similarly, I am working with mistral's 7B instruct model but problem persists with other models, such as GPT2 - not found a working model yet.

## Minimum code to reproduce:
```
from transformers import AutoModelForCausalLM, AutoTokenizer, LogitsProcessorList, LogitsProcessor
from data.code.implementation.newkirch.extended_watermark_processor import WatermarkLogitsProcessor
import torch

device = "cuda"
model_name = "gpt2"
# model_name = "mistralai/Mistral-7B-Instruct-v0.2" # Mistral AI model

model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map=device)
tokenizer = AutoTokenizer.from_pretrained(model_name)

class CustomLogitsProcessor(LogitsProcessor):
    def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor:
        return scores

def generate_essay(prompt):
    messages = [{
        "role": "user",
        "content": prompt
    }]

    model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(device)

    # Setting `pad_token_id` to `eos_token_id` for open-ended generation.
    generated_ids = model.generate(
        model_inputs,
        max_new_tokens=7500,
        do_sample=True,
        pad_token_id=tokenizer.eos_token_id,
        logits_processor=LogitsProcessorList([CustomLogitsProcessor])
    )

    decoded = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
    text = decoded[0].split("
")[1]
    return text

prompt = '''You are a student working on the following assignment.

Create an essay based on the following topic in no more than a 100 words.

Topic: Why are cats better than dogs? 
'''

text = generate_essay(prompt)
print(text)
```


## Response/error:
```
Traceback (most recent call last):
  File "C:\Users\Sam\Desktop\Level4-Proj\data\mistral_test.py", line 41, in <module>
    text = generate_essay(prompt)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sam\Desktop\Level4-Proj\data\mistral_test.py", line 22, in generate_essay
    generated_ids = model.generate(
                    ^^^^^^^^^^^^^^^
  File "C:\Users\Sam\anaconda3\envs\wmark-pt\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sam\anaconda3\envs\wmark-pt\Lib\site-packages\transformers\generation\utils.py", line 1777, in generate
    return self.sample(
           ^^^^^^^^^^^^
  File "C:\Users\Sam\anaconda3\envs\wmark-pt\Lib\site-packages\transformers\generation\utils.py", line 2887, in sample
    next_token_scores = logits_processor(input_ids, next_token_logits)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sam\anaconda3\envs\wmark-pt\Lib\site-packages\transformers\generation\logits_process.py", line 94, in __call__
    raise ValueError(
ValueError: Make sure that all the required parameters: ['self', 'input_ids', 'scores'] for <class 'type'> are passed to the logits processor.
```

From my investigation, it looks like it is getting caught up [here](https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py), on line 90.

I have verified that "scores" and "input_ids" are both present when the call is made. 

Not sure if the `function_args` should be checking in `list(function_args.keys()[3:])` but this is where the error is happening. 


# Expectations

I would expect the model to generate some text corresponding to the prompt.
In an effort to show that the logit processor is doing nothing, sampling is off - results should be deterministic.

The text produced should be very similar to the text produced without the logits processor. 

Comments:
I spent far too long on this. I had forgotten to instantiate my custom processor class.

Thanks for sharing! 🤗