Skip to content

Commit 9729a47

Browse files
authored
Change Pipeline's name & Fix dense qa config & Add FAQ (#3202)
1 parent 2c82f03 commit 9729a47

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

pipelines/FAQ.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,7 @@ python 3.7版本引起的错误,修改如下代码:
123123
# 增加batch_size参数,传入一个数值即可
124124
document_store.update_embeddings(retriever, batch_size=256)
125125
```
126+
127+
#### 运行后台程序出现了错误:`Exception: Failed loading pipeline component 'DocumentStore': RequestError(400, 'illegal_argument_exception', 'Mapper for [embedding] conflicts with existing mapper:\n\tCannot update parameter [dims] from [312] to [768]')`
128+
129+
以语义检索为例,这是因为模型的维度不对造成的,请检查一下 `elastic search`中的文本的向量的维度和`semantic_search.yaml`里面`DocumentStore`设置的维度`embedding_dim`是否一致,如果不一致,请重新使用`utils/offline_ann.py`构建索引。总之,请确保构建索引所用到的模型和`semantic_search.yaml`设置的模型是一致的。

pipelines/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Note: 因为 pipelines 依赖较多, 安装耗时大概 10 分钟左右,安装
5757
- Docker 18.03 以上
5858
### pip 安装
5959
```
60-
pip install --upgrade pipelines
60+
pip install --upgrade paddle-pipelines
6161
```
6262

6363
### 源码安装

pipelines/rest_api/pipeline/dense_qa.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ components: # define all the building-blocks for Pipeline
66
params:
77
host: localhost
88
index: baike_cities
9+
embedding_dim: 312
910
port: 9200
1011
- name: Retriever
1112
type: DensePassageRetriever
1213
params:
1314
document_store: DocumentStore # params can reference other components defined in the YAML
1415
top_k: 10
15-
query_embedding_model: rocketqa-zh-dureader-query-encoder
16-
passage_embedding_model: rocketqa-zh-dureader-query-encoder
16+
query_embedding_model: rocketqa-zh-nano-query-encoder
17+
passage_embedding_model: rocketqa-zh-nano-query-encoder
1718
embed_title: False
1819
- name: Ranker # custom-name for the component; helpful for visualization & debugging
1920
type: ErnieRanker # pipelines Class name for the component

pipelines/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
with open("requirements.txt") as fin:
2323
REQUIRED_PACKAGES = fin.read()
2424

25-
setuptools.setup(name="pipelines",
25+
setuptools.setup(name="paddle-pipelines",
2626
version=pipelines.__version__,
2727
author="PaddlePaddle Speech and Language Team",
2828
author_email="[email protected]",

pipelines/utils/offline_ann.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
data_dict = {
1111
'data/dureader_dev':
1212
"https://paddlenlp.bj.bcebos.com/applications/dureader_dev.zip",
13-
"data/baike": "https://paddlenlp.bj.bcebos.com/applications/baike.zip"
13+
"data/baike": "https://paddlenlp.bj.bcebos.com/applications/baike.zip",
14+
"data/insurance":
15+
"https://paddlenlp.bj.bcebos.com/applications/insurance.zip"
1416
}
1517

1618
parser = argparse.ArgumentParser()

0 commit comments

Comments
 (0)