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

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

软件环境

  1. - paddlepaddle:develop
  2. - paddlepaddle-gpu: develop 11.8
  3. - paddlenlp: lastest 4609d07a54ab97974b962b536dde7164ab15db93

重复问题

  • 我已搜索了现有的问题

错误描述

  1. �[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.
  2. 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
  3. (…)Qwen2-7B-Instruct/generation_config.json: 100%|█| 208/208 [00:00<00:00, 1.01M
  4. �[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
  5. �[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
  6. �[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
  7. �[32m[2024-06-11 23:38:33,064] [ INFO]�[0m - Loading configuration file /home/aistudio/.paddlenlp/models/Qwen/Qwen2-7B-Instruct/config.json�[0m
  8. �[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
  9. �[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
  10. �[32m[2024-06-11 23:38:33,067] [ INFO]�[0m - Start predict�[0m
  11. Traceback (most recent call last):
  12. File "/home/aistudio/work/PaddleNLP-develop/llm/predictor.py", line 1626, in <module>
  13. predict()
  14. File "/home/aistudio/work/PaddleNLP-develop/llm/predictor.py", line 1573, in predict
  15. outputs = predictor.predict(batch_source_text)
  16. File "/home/aistudio/work/PaddleNLP-develop/llm/predictor.py", line 252, in predict
  17. predictions = self._infer(tokenized_source)
  18. File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/decorator.py", line 232, in fun
  19. return caller(func, *(extras + args), **kw)
  20. File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/base/dygraph/base.py", line 337, in _decorate_function
  21. return func(*args, **kwargs)
  22. File "/home/aistudio/work/PaddleNLP-develop/llm/predictor.py", line 299, in _infer
  23. result = self.model.generate(
  24. File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/decorator.py", line 232, in fun
  25. return caller(func, *(extras + args), **kw)
  26. File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/base/dygraph/base.py", line 337, in _decorate_function
  27. return func(*args, **kwargs)
  28. File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddlenlp/generation/utils.py", line 941, in generate
  29. return self.sample(
  30. File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddlenlp/generation/utils.py", line 1183, in sample
  31. outputs = self(**model_inputs)
  32. File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1426, in __call__
  33. return self.forward(*inputs, **kwargs)
  34. TypeError: Qwen2ForCausalLM.forward() got an unexpected keyword argument 'output_router_logits'

稳定复现步骤 & 代码

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

mum43rcc1#

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

相关问题