Skip to content

[Bug]: Qwen2ForCausalLM.forward() got an unexpected keyword argument 'output_router_logits' #8583

@sanbuphy

Description

@sanbuphy

软件环境

- paddlepaddle:develop - paddlepaddle-gpu: develop 11.8 - paddlenlp: lastest 4609d07a54ab97974b962b536dde7164ab15db93

重复问题

  • I have searched the existing issues

错误描述

[32m[2024-06-11 23:38:32,956] [ INFO][0m - All the weights of Qwen2ForCausalLM were initialized from the model checkpoint at Qwen/Qwen2-7B-Instruct. If your task is similar to the task the model of the checkpoint was trained on, you can already use Qwen2ForCausalLM for predictions without further training.�[0m (…)Qwen2-7B-Instruct/generation_config.json: 100%|█| 208/208 [00:00<00:00, 1.01M �[32m[2024-06-11 23:38:33,063] [ INFO][0m - Loading configuration file /home/aistudio/.paddlenlp/models/Qwen/Qwen2-7B-Instruct/generation_config.json�[0m �[32m[2024-06-11 23:38:33,064] [ INFO][0m - Generation config file not found, using a generation config created from the model config.�[0m �[32m[2024-06-11 23:38:33,064] [ INFO][0m - We are using <class 'paddlenlp.transformers.qwen2.configuration.Qwen2Config'> to load 'Qwen/Qwen2-7B-Instruct'.�[0m �[32m[2024-06-11 23:38:33,064] [ INFO][0m - Loading configuration file /home/aistudio/.paddlenlp/models/Qwen/Qwen2-7B-Instruct/config.json�[0m �[32m[2024-06-11 23:38:33,065] [ INFO][0m - Loading configuration file /home/aistudio/.paddlenlp/models/Qwen/Qwen2-7B-Instruct/generation_config.json�[0m �[33m[2024-06-11 23:38:33,065] [ WARNING][0m - Can't find generation config, so it will not use generation_config field in the model config�[0m �[32m[2024-06-11 23:38:33,067] [ INFO][0m - Start predict�[0m Traceback (most recent call last): File "/home/aistudio/work/PaddleNLP-develop/llm/predictor.py", line 1626, in <module> predict() File "/home/aistudio/work/PaddleNLP-develop/llm/predictor.py", line 1573, in predict outputs = predictor.predict(batch_source_text) File "/home/aistudio/work/PaddleNLP-develop/llm/predictor.py", line 252, in predict predictions = self._infer(tokenized_source) File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw) File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/base/dygraph/base.py", line 337, in _decorate_function return func(*args, **kwargs) File "/home/aistudio/work/PaddleNLP-develop/llm/predictor.py", line 299, in _infer result = self.model.generate( File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw) File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/base/dygraph/base.py", line 337, in _decorate_function return func(*args, **kwargs) File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddlenlp/generation/utils.py", line 941, in generate return self.sample( File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddlenlp/generation/utils.py", line 1183, in sample outputs = self(**model_inputs) File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1426, in __call__ return self.forward(*inputs, **kwargs) TypeError: Qwen2ForCausalLM.forward() got an unexpected keyword argument 'output_router_logits'

稳定复现步骤 & 代码

python predictor.py --model_name_or_path Qwen/Qwen2-7B-Instruct --dtype float16

Metadata

Metadata

Labels

bugSomething isn't workingstale

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions