Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
sanbuphy opened this issue Jun 11, 2024 · 0 comments
Open
1 task done
Assignees
Labels
bug Something isn't working

Comments

@sanbuphy
Copy link

软件环境

- 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

@sanbuphy sanbuphy added the bug Something isn't working label Jun 11, 2024
@sanbuphy sanbuphy changed the title [Bug]: output_router_logits [Bug]: Qwen2ForCausalLM.forward() got an unexpected keyword argument 'output_router_logits' Jun 12, 2024
@DrownFish19 DrownFish19 self-assigned this Jun 12, 2024
DrownFish19 added a commit to DrownFish19/PaddleNLP that referenced this issue Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants