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.93k stars 2.91k forks source link

[Question]: "dialogue"模型无法正确加载出现错误 #7156

Closed glnshzh closed 7 months ago

glnshzh commented 11 months ago

请提出你的问题

描述:在同样win11的环境中,一台机子行,一台机子报错 测试代码: from paddlenlp import Taskflow from paddlenlp import SimpleServer dialogue = Taskflow("dialogue") print(dialogue(["你是谁"]))

报错信息: C:\QQROBOT\bott.venv\Scripts\python.exe C:\QQROBOT\bott\server.py C:\QQROBOT\bott.venv\lib\site-packages_distutils_hack__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") [2023-10-02 22:47:03,481] [ INFO] - Already cached C:\Users\47818.paddlenlp\models\plato-mini\plato-mini-vocab.txt [2023-10-02 22:47:03,481] [ INFO] - Already cached C:\Users\47818.paddlenlp\models\plato-mini\plato-mini-spm.model [2023-10-02 22:47:03,532] [ INFO] - tokenizer config file saved in C:\Users\47818.paddlenlp\models\plato-mini\tokenizer_config.json [2023-10-02 22:47:03,532] [ INFO] - Special tokens file saved in C:\Users\47818.paddlenlp\models\plato-mini\special_tokens_map.json [2023-10-02 22:47:03,535] [ INFO] - Already cached C:\Users\47818.paddlenlp\models\plato-mini\model_state.pdparams [2023-10-02 22:47:03,535] [ INFO] - Loading weights file model_state.pdparams from cache at C:\Users\47818.paddlenlp\models\plato-mini\model_state.pdparams [2023-10-02 22:47:05,927] [ INFO] - Loaded weights file from disk, setting weights to model. W1002 22:47:05.998544 8208 gpu_resources.cc:96] The GPU architecture in your current machine is Pascal, which is not compatible with Paddle installation with arch: 70 75 80 86 , it is recommended to install the corresponding wheel package according to the installation information on the official Paddle website. W1002 22:47:05.998544 8208 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 12.2, Runtime API Version: 12.0 W1002 22:47:06.001032 8208 gpu_resources.cc:149] device: 0, cuDNN Version: 8.9. [2023-10-02 22:47:06,277] [ INFO] - All model checkpoint weights were used when initializing UnifiedTransformerLMHeadModel.

[2023-10-02 22:47:06,278] [ INFO] - All the weights of UnifiedTransformerLMHeadModel were initialized from the model checkpoint at plato-mini. If your task is similar to the task the model of the checkpoint was trained on, you can already use UnifiedTransformerLMHeadModel for predictions without further training. [2023-10-02 22:47:06,437] [ INFO] - Generation config file not found, using a generation config created from the model config. Building prefix dict from the default dictionary ... [2023-10-02 22:47:06,460] [ DEBUG] init.py:113 - Building prefix dict from the default dictionary ... Loading model from cache C:\Users\47818\AppData\Local\Temp\jieba.cache [2023-10-02 22:47:06,461] [ DEBUG] init.py:132 - Loading model from cache C:\Users\47818\AppData\Local\Temp\jieba.cache Loading model cost 0.562 seconds. [2023-10-02 22:47:07,023] [ DEBUG] init.py:164 - Loading model cost 0.562 seconds. Prefix dict has been built successfully. [2023-10-02 22:47:07,023] [ DEBUG] init.py:166 - Prefix dict has been built successfully. [2023-10-02 22:47:07,023] [ WARNING] - max_length will be deprecated in future releases, use max_new_tokens instead. [2023-10-02 22:47:07,023] [ WARNING] - min_length will be deprecated in future releases, use min_new_token instead. Traceback (most recent call last): File "C:\QQROBOT\bott\server.py", line 4, in print(dialogue(["你是谁"])) File "C:\QQROBOT\bott.venv\lib\site-packages\paddlenlp\taskflow\taskflow.py", line 817, in call results = self.task_instance(inputs, kwargs) File "C:\QQROBOT\bott.venv\lib\site-packages\paddlenlp\taskflow\task.py", line 527, in call outputs = self._run_model(inputs, kwargs) File "C:\QQROBOT\bott.venv\lib\site-packages\paddlenlp\taskflow\dialogue.py", line 246, in _run_model ids, scores = self._model.generate( File "C:\QQROBOT\bott.venv\lib\site-packages\decorator.py", line 232, in fun return caller(func, *(extras + args), *kw) File "C:\QQROBOT\bott.venv\lib\site-packages\paddle\fluid\dygraph\base.py", line 347, in _decorate_function return func(args, **kwargs) File "C:\QQROBOT\bott.venv\lib\site-packages\paddlenlp\generation\utils.py", line 992, in generate return self.sample( File "C:\QQROBOT\bott.venv\lib\site-packages\paddlenlp\generation\utils.py", line 1224, in sample next_tokens = paddle.multinomial(probs) File "C:\QQROBOT\bott.venv\lib\site-packages\paddle\tensor\random.py", line 191, in multinomial return _C_ops.multinomial(x, num_samples, replacement) ValueError: (InvalidArgument) When replacement=False, 'num_samples' must less than or eaqual to the number of positive item of input [Hint: Expected int_num_samples <= valid_samples, but received int_num_samples:1 > valid_samples:0.] (at C:\home\workspace\Paddle\paddle\phi\kernels\gpu\multinomial_kernel.cu:173)

Process finished with exit code 1

glnshzh commented 11 months ago

在同样win11的环境中,一台1070,一台3070ti,paddlenlp为2.6.0,cuda都为12.0,paddle为符合版本安装。1070不行,3070ti行,且这个模型比较小,确认没有出现爆显存内存情况

glnshzh commented 11 months ago

是否直接引用不行,需要自行部署?

wqysq commented 10 months ago

你好,请问后来解决了么,遇到了和你一样的问题,1080ti的显卡

glnshzh commented 10 months ago

你好,请问后来解决了么,遇到了和你一样的问题,1080ti的显卡 没有,好像也没人理,晕,那应该是显卡10系问题了

wqysq commented 10 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,您的来信我已收到,非常感谢。

github-actions[bot] commented 8 months ago

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

github-actions[bot] commented 7 months ago

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

wqysq commented 7 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,您的来信我已收到,非常感谢。