PaddlePaddle / RocketQA

🚀 RocketQA, dense retrieval for information retrieval and question answering, including both Chinese and English state-of-the-art models.
Apache License 2.0
767 stars 128 forks source link

提问无法收到回复。 #28

Closed fangjiyuan closed 2 years ago

fangjiyuan commented 2 years ago

python版本3.7.3 jina版本2.4.5

Question: (type \q to quit)Who is Paula Deen's brother? UserWarning: ignored unknown argument: ['8886']. (raised from /home/fangjiyuan/.local/lib/python3.7/site-packages/jina/helper.py:689)
du_encoder@63982[E]:AttributeError("'generator' object has no attribute 'squeeze'") add "--quiet-error" to suppress the exception details
Traceback (most recent call last): File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/peapods/runtimes/zmq/zed.py", line 285, in _msg_callback processed_msg = self._callback(msg) File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/peapods/runtimes/zmq/zed.py", line 271, in _callback msg = self._post_hook(self._handle(self._pre_hook(msg))) File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/peapods/runtimes/zmq/zed.py", line 226, in _handle peapod_name=self.name, File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/peapods/runtimes/request_handlers/data_request_handler.py", line 165, in handle field='groundtruths', File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/executors/init.py", line 196, in call self, kwargs File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/executors/decorators.py", line 105, in arg_wrapper return fn(args, kwargs) File "/home/fangjiyuan/github_file/RocketQA/examples/jina_example/rocketqa_encoder/executor.py", line 39, in encode_question doc.embedding = query_emb.squeeze() AttributeError: 'generator' object has no attribute 'squeeze' vec_indexer@63990[E]:TypeError("can not determine the array type: ['builtins'].NoneType") add "--quiet-error" to suppress the exception details
Traceback (most recent call last): File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/peapods/runtimes/zmq/zed.py", line 285, in _msg_callback processed_msg = self._callback(msg) File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/peapods/runtimes/zmq/zed.py", line 271, in _callback msg = self._post_hook(self._handle(self._pre_hook(msg))) File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/peapods/runtimes/zmq/zed.py", line 226, in _handle peapod_name=self.name, File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/peapods/runtimes/request_handlers/data_request_handler.py", line 165, in handle field='groundtruths', File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/executors/init.py", line 196, in call self,
kwargs File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/executors/decorators.py", line 105, in arg_wrapper return fn(
args,
kwargs) File "/home/fangjiyuan/.jina/hub-packages/zb38xlt4/executor.py", line 78, in search docs.match(self._storage, *match_args) File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/types/arrays/mixins/match.py", line 141, in match dist, idx = lhv._match(rhv, cdist, _limit, normalization, metric_name) File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/types/arrays/mixins/match.py", line 194, in _match dists = cdist(x_mat, y_mat, metric_name) File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/types/arrays/mixins/match.py", line 127, in cdist = lambda x: _cdist(*x, device=device) File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/math/distance/init.py", line 37, in cdist x_type = get_array_type(x_mat) File "/home/fangjiyuan/.local/lib/python3.7/site-packages/jina/types/ndarray/init.py", line 310, in get_array_type raise TypeError(f'can not determine the array type: {module_tags}.{class_name}') TypeError: can not determine the array type: ['builtins'].NoneType <jina.types.document.Document ('id', 'mime_type', 'text') at 140657475693760>

nan-wang commented 2 years ago

File "/home/fangjiyuan/github_file/RocketQA/examples/jina_example/rocketqa_encoder/executor.py", line 39, in encode_question doc.embedding = query_emb.squeeze() @fangjiyuan May I have your paddle version?

fangjiyuan commented 2 years ago

File "/home/fangjiyuan/github_file/RocketQA/examples/jina_example/rocketqa_encoder/executor.py", line 39, in encode_question doc.embedding = query_emb.squeeze() @fangjiyuan May I have your paddle version?

paddle version is 2.2.2.

fangjiyuan commented 2 years ago

我觉的是因为rocketqa的版本1.1.0有问题,我用1.0.0就没有报错。

sfwydyc commented 2 years ago

我觉的是因为rocketqa的版本1.1.0有问题,我用1.0.0就没有报错。

是的,RocketQA 1.1.0模型预测结果的数据结构稍有改动,faiss example和jina example的写法也需要修改,最好重新pull一下example的代码

fangjiyuan commented 2 years ago

重新拉取代码之后可以正常运行了。