PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
11.99k stars 2.93k forks source link

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

Closed sanbuphy closed 1 month ago

sanbuphy commented 3 months ago

软件环境

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

重复问题

错误描述

[2024-06-11 23:38:32,956] [    INFO] - 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.
(…)Qwen2-7B-Instruct/generation_config.json: 100%|█| 208/208 [00:00<00:00, 1.01M
[2024-06-11 23:38:33,063] [    INFO] - Loading configuration file /home/aistudio/.paddlenlp/models/Qwen/Qwen2-7B-Instruct/generation_config.json
[2024-06-11 23:38:33,064] [    INFO] - Generation config file not found, using a generation config created from the model config.
[2024-06-11 23:38:33,064] [    INFO] - We are using <class 'paddlenlp.transformers.qwen2.configuration.Qwen2Config'> to load 'Qwen/Qwen2-7B-Instruct'.
[2024-06-11 23:38:33,064] [    INFO] - Loading configuration file /home/aistudio/.paddlenlp/models/Qwen/Qwen2-7B-Instruct/config.json
[2024-06-11 23:38:33,065] [    INFO] - Loading configuration file /home/aistudio/.paddlenlp/models/Qwen/Qwen2-7B-Instruct/generation_config.json
[2024-06-11 23:38:33,065] [ WARNING] - Can't find generation config, so it will not use generation_config field in the model config
[2024-06-11 23:38:33,067] [    INFO] - Start predict
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

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。