ValueError: The following `model_kwargs` are not used by the model: ['skip_special_tokens']

### Reminder

- [X] I have read the README and searched the existing issues.

### System Info

$ llamafactory-cli env

- `llamafactory` version: 0.9.2.dev0
- Platform: Linux-4.18.0-553.27.1.el8_10.x86_64-x86_64-with-glibc2.28
- Python version: 3.11.10
- PyTorch version: 2.5.1+cu124 (GPU)
- Transformers version: 4.46.1
- Datasets version: 3.1.0
- Accelerate version: 1.0.1
- PEFT version: 0.12.0
- TRL version: 0.9.6
- GPU type: NVIDIA L40S-48C
- Bitsandbytes version: 0.45.0

### Reproduction

Dear Llama-Factory team,

I created a a LoRA adapter which worked out of the box for Llama 3.3, thank you very much.

Unfortunately, when I wanted to evaluate the model with the adapter, I get this error

```bash
llamafactory-cli train examples/extras/nlg_eval/llama3_lora_predict.yaml
```

```bash
***** Running Prediction *****
[INFO|trainer.py:4119] 2024-12-19 10:32:25,907 >>   Num examples = 347
[INFO|trainer.py:4122] 2024-12-19 10:32:25,907 >>   Batch size = 1
[rank0]: Traceback (most recent call last):
[rank0]:   File "/packages/LLaMA-Factory/src/llamafactory/launcher.py", line 23, in <module>
[rank0]:     launch()
[rank0]:   File "/packages/LLaMA-Factory/src/llamafactory/launcher.py", line 19, in launch
[rank0]:     run_exp()
[rank0]:   File "/packages/LLaMA-Factory/src/llamafactory/train/tuner.py", line 50, in run_exp
[rank0]:     run_sft(model_args, data_args, training_args, finetuning_args, generating_args, callbacks)
[rank0]:   File "/packages/LLaMA-Factory/src/llamafactory/train/sft/workflow.py", line 128, in run_sft
[rank0]:     predict_results = trainer.predict(dataset_module["eval_dataset"], metric_key_prefix="predict", **gen_kwargs)
[rank0]:                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/trainer_seq2seq.py", line 259, in predict
[rank0]:     return super().predict(test_dataset, ignore_keys=ignore_keys, metric_key_prefix=metric_key_prefix)
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/trainer.py", line 4042, in predict
[rank0]:     output = eval_loop(
[rank0]:              ^^^^^^^^^^
[rank0]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/trainer.py", line 4158, in evaluation_loop
[rank0]:     losses, logits, labels = self.prediction_step(model, inputs, prediction_loss_only, ignore_keys=ignore_keys)
[rank0]:                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/packages/LLaMA-Factory/src/llamafactory/train/sft/trainer.py", line 126, in prediction_step
[rank0]:     loss, generated_tokens, _ = super().prediction_step(  # ignore the returned labels (may be truncated)
[rank0]:                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/trainer_seq2seq.py", line 331, in prediction_step
[rank0]:     generated_tokens = self.model.generate(**generation_inputs, **gen_kwargs)
[rank0]:                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/peft/peft_model.py", line 1638, in generate
[rank0]:     outputs = self.base_model.generate(*args, **kwargs)
[rank0]:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
[rank0]:     return func(*args, **kwargs)
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/generation/utils.py", line 1972, in generate
[rank0]:     self._validate_model_kwargs(model_kwargs.copy())
[rank0]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/generation/utils.py", line 1360, in _validate_model_kwargs
[rank0]:     raise ValueError(
[rank0]: ValueError: The following `model_kwargs` are not used by the model: ['skip_special_tokens'] (note: typos in the generate arguments will also show up in this list)
[rank1]: Traceback (most recent call last):
[rank1]:   File "/packages/LLaMA-Factory/src/llamafactory/launcher.py", line 23, in <module>
[rank1]:     launch()
[rank1]:   File "/packages/LLaMA-Factory/src/llamafactory/launcher.py", line 19, in launch
[rank1]:     run_exp()
[rank1]:   File "/packages/LLaMA-Factory/src/llamafactory/train/tuner.py", line 50, in run_exp
[rank1]:     run_sft(model_args, data_args, training_args, finetuning_args, generating_args, callbacks)
[rank1]:   File "/packages/LLaMA-Factory/src/llamafactory/train/sft/workflow.py", line 128, in run_sft
[rank1]:     predict_results = trainer.predict(dataset_module["eval_dataset"], metric_key_prefix="predict", **gen_kwargs)
[rank1]:                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank1]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/trainer_seq2seq.py", line 259, in predict
[rank1]:     return super().predict(test_dataset, ignore_keys=ignore_keys, metric_key_prefix=metric_key_prefix)
[rank1]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/trainer.py", line 4042, in predict
[rank1]:     output = eval_loop(
[rank1]:              ^^^^^^^^^^
[rank1]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/trainer.py", line 4158, in evaluation_loop
[rank1]:     losses, logits, labels = self.prediction_step(model, inputs, prediction_loss_only, ignore_keys=ignore_keys)
[rank1]:                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank1]:   File "/packages/LLaMA-Factory/src/llamafactory/train/sft/trainer.py", line 126, in prediction_step
[rank1]:     loss, generated_tokens, _ = super().prediction_step(  # ignore the returned labels (may be truncated)
[rank1]:                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank1]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/trainer_seq2seq.py", line 331, in prediction_step
[rank1]:     generated_tokens = self.model.generate(**generation_inputs, **gen_kwargs)
[rank1]:                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank1]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/peft/peft_model.py", line 1638, in generate
[rank1]:     outputs = self.base_model.generate(*args, **kwargs)
[rank1]:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank1]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
[rank1]:     return func(*args, **kwargs)
[rank1]:            ^^^^^^^^^^^^^^^^^^^^^
[rank1]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/generation/utils.py", line 1972, in generate
[rank1]:     self._validate_model_kwargs(model_kwargs.copy())
[rank1]:   File "/environments/llama_factory_uat/lib64/python3.11/site-packages/transformers/generation/utils.py", line 1360, in _validate_model_kwargs
[rank1]:     raise ValueError(
[rank1]: ValueError: The following `model_kwargs` are not used by the model: ['skip_special_tokens'] (note: typos in the generate arguments will also show up in this list)
[rank0]:[W1219 10:32:26.479931128 ProcessGroupNCCL.cpp:1250] Warning: WARNING: process group has NOT been destroyed before we destruct ProcessGroupNCCL. On normal program exit, the application should call destro
y_process_group to ensure that any pending NCCL operations have finished in this process. In rare cases this process can exit before this point and block the progress of another member of the process group. This
 constraint has always been present,  but this warning has only been added since PyTorch 2.4 (function operator())
W1219 10:32:27.427000 2498183 torch/distributed/elastic/multiprocessing/api.py:897] Sending process 2498202 closing signal SIGTERM
E1219 10:32:27.591000 2498183 torch/distributed/elastic/multiprocessing/api.py:869] failed (exitcode: 1) local_rank: 0 (pid: 2498201) of binary: /environments/llama_factory_uat/bin/python3.11
Traceback (most recent call last):
  File "/environments/llama_factory_uat/bin/torchrun", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/environments/llama_factory_uat/lib64/python3.11/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 355, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/environments/llama_factory_uat/lib64/python3.11/site-packages/torch/distributed/run.py", line 919, in main
    run(args)
  File "/environments/llama_factory_uat/lib64/python3.11/site-packages/torch/distributed/run.py", line 910, in run
    elastic_launch(
  File "/environments/llama_factory_uat/lib64/python3.11/site-packages/torch/distributed/launcher/api.py", line 138, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/environments/llama_factory_uat/lib64/python3.11/site-packages/torch/distributed/launcher/api.py", line 269, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:

```

my `llama3_lora_predict.yaml`

```yaml
### model
model_name_or_path: /Llama-3.3-70B-Instruct-bnb-4bit
adapter_name_or_path: saves/llama3.3-70b/lora/sft
trust_remote_code: true

### method
stage: sft
do_predict: true
finetuning_type: lora

### dataset
eval_dataset: JB_translate_test
template: llama3
cutoff_len: 4096
#max_samples: 50
overwrite_cache: true
preprocessing_num_workers: 16

### output
output_dir: saves/llama3.3-70b/lora/predict
overwrite_output_dir: true

### eval
per_device_eval_batch_size: 1
predict_with_generate: true
ddp_timeout: 180000000

```

### Expected behavior

_No response_

### Others

_No response_

Labels: solved
State: closed