PaddleNLP icon indicating copy to clipboard operation
PaddleNLP copied to clipboard

[Question]: 使用skep_ernie_1.0_large_ch模型做情感分析出错

Open DigYang opened this issue 2 years ago • 4 comments

环境:

macos,M1 paddlenlp 2.6.1 paddlepaddle 2.5.2

代码:

from paddlenlp import Taskflow

senta = Taskflow("sentiment_analysis", model="skep_ernie_1.0_large_ch")
result = senta(["房间不大,很干净", "老板服务热情,价格也便宜", "这个产品用起来真的很流畅,我非常喜欢"])
print(result)

报错:

warnings.warn("Setuptools is replacing distutils.")
[2023-11-12 20:30:00,383] [    INFO] - Already cached /Users/shawn/.paddlenlp/models/skep_ernie_1.0_large_ch/skep_ernie_1.0_large_ch.vocab.txt
[2023-11-12 20:30:00,388] [    INFO] - tokenizer config file saved in /Users/shawn/.paddlenlp/models/skep_ernie_1.0_large_ch/tokenizer_config.json
[2023-11-12 20:30:00,388] [    INFO] - Special tokens file saved in /Users/shawn/.paddlenlp/models/skep_ernie_1.0_large_ch/special_tokens_map.json
E1112 20:30:00.389102 4094450496 analysis_config.cc:630] Please compile with MKLDNN first to use MKLDNN
/Users/shawn/Library/Python/3.9/lib/python/site-packages/paddlenlp/transformers/tokenizer_utils_base.py:2293: FutureWarning: The `max_seq_len` argument is deprecated and will be removed in a future version, please use `max_length` instead.
  warnings.warn(
/Users/shawn/Library/Python/3.9/lib/python/site-packages/paddlenlp/transformers/tokenizer_utils_base.py:1865: UserWarning: Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation=True` to explicitly truncate examples to max length. Defaulting to 'longest_first' truncation strategy. If you encode pairs of sequences (GLUE-style) with the tokenizer you can select this strategy more precisely by providing a specific strategy to `truncation`.
  warnings.warn(
zsh: bus error  /usr/bin/python3 test.py

DigYang avatar Nov 12 '23 12:11 DigYang

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

github-actions[bot] avatar Jan 12 '24 00:01 github-actions[bot]

同样的问题? win11 paddlenlp 2.6.1 paddlepaddle 2.6.0

Lshan523 avatar Jan 25 '24 03:01 Lshan523

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

github-actions[bot] avatar Apr 27 '24 00:04 github-actions[bot]

taskflow默认开启了mkldnn(MAC上是无法用mkldnn),另外,skep模型比较大,检查一下内存是否充足。

看一下下面的文档是否对您有帮助:

https://www.paddlepaddle.org.cn/documentation/docs/zh/guides/flags/data_cn.html#flags-use-mkldnn

w5688414 avatar Apr 29 '24 08:04 w5688414