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
12.11k stars 2.94k forks source link

pipelines流水线系统自定义模型报错:AttributeError: 'DensePassageRetriever' object has no attribute 'passage_encoder' #5748

Closed gg22mm closed 1 year ago

gg22mm commented 1 year ago

请提出你的问题

pipelines流水线系统自定义模型报错 AttributeError: 'DensePassageRetriever' object has no attribute 'passage_encoder'

# 环境: paddle-bfloat 0.1.7 paddle2onnx 1.0.6 paddlefsl 1.1.0 paddlenlp 2.5.2 paddleocr 2.6.1.3 paddlepaddle 2.4.2

PaddleNLP-develop.zip 是当前最新下载的包: cd ./pipelines
pip install -r requirements.txt 环境应该没有问题的。 #

图片 图片

其中:./checkpoints/model_2000/model_state.pdparams 是我通过召回训练所得: 召回训练说明:https://github.com/PaddlePaddle/PaddleNLP/tree/develop/applications/neural_search/recall/simcse python train.py --device cpu --save_dir ./checkpoints/ --batch_size 2 --learning_rate 5E-5 --epochs 3 --save_steps 2000 --eval_steps 100 --max_seq_length 64 --infer_with_fc_pooler --dropout 0.2 --output_emb_size 256 --train_set_file "./data/train_unsupervised.csv" --test_set_file "./data/dev.csv" --model_name_or_path "rocketqa-zh-dureader-query-encoder"

问题是最后放到 pipelines流水线系统自定义模型报错 AttributeError: 'DensePassageRetriever' object has no attribute 'passage_encoder' ,报错是怎么回事呢?

w5688414 commented 1 year ago

您好,pipelines最近做了不兼容性升级,不支持加载neural search的模型了,正在紧急修复中。

  1. 另外,降低pipelines版本可以加载