PaddleNLP [Bug]: Qwen2ForCausalLM.forward()收到了一个意外的关键字参数'output_router_logits'

kknvjkwl  于 5个月前  发布在  Git
关注(0)|答案(1)|浏览(164)

软件环境

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

重复问题

  • 我已搜索了现有的问题

错误描述

�[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
mum43rcc

mum43rcc1#

这个问题已经过时了,因为它已经开放了60天,没有任何活动。当前的问题在60天内没有活动,被标记为过时。

相关问题