jina-ai/examples

The wikipedia-sentences example doesn't work with latest 2.0.10

bikash119 opened this issue · 2 comments

Successfully installed jina-2.0.0rc5.dev15
(wikisearch) boredmgr@Bikashs-MacBook-Pro wiki-search % python3 app.py -t index
pod0@41200[I]:starting jina.peapods.runtimes.zmq.zed.ZEDRuntime...
pod0@41200[I]:input tcp://0.0.0.0:56504 (PULL_BIND) output tcp://0.0.0.0:56508 (PUSH_CONNECT) control over tcp://0.0.0.0:56503 (PAIR_BIND)
...
JINA@41201[S]:successfully built NumpyIndexer from a yaml config
JINA@41200[S]:successfully built MyTransformer from a yaml config
...
gateway@41202[I]:prefetching 50 requests takes 0 seconds (0.01s)
pod0@41200[I]:recv DataRequest (/index) from gateway▸pod0/ZEDRuntime▸⚐
pod0@41200[I]:#sent: 0 #recv: 1 sent_size: 0 Bytes recv_size: 5.6 KB
...
Please type a sentence: Dharmapuri block is a
Client@41198[S]:connected to the gateway at 0.0.0.0:56514!
|█ | 📃 0 ⏱️ 0.0s 🐎 0.0/s 0 requests ... gateway@41202[I]:prefetching 50 requests...
gateway@41202[W]:if this takes too long, you may want to take smaller "--prefetch" or ask client to reduce "--request-size"
gateway@41202[I]:prefetching 50 requests takes 0 seconds (0.00s)
pod0@41200[I]:recv DataRequest (/search) from gateway▸pod0/ZEDRuntime▸⚐
pod0@41200[I]:#sent: 1 #recv: 2 sent_size: 159.9 KB recv_size: 6.0 KB
pod1@41201[I]:recv DataRequest (/search) from gateway▸pod0/ZEDRuntime▸pod1/ZEDRuntime▸⚐
pod1@41201[I]:#sent: 1 #recv: 2 sent_size: 159.9 KB recv_size: 163.3 KB

Ta-Dah🔮, here's what we found for: Dharmapuri block is a

0(0.79). Dharmapuri block is a revenue block in the Dharmapuri district of Tamil Nadu, India.

1(0.36). In 1991, it moved to the State University of New York College at Brockport.

2(0.34). It was founded in England in 1891 and granted its Royal Charter in 1902.

3(0.28). BBC School Radio is a division of the BBC providing audio learning resources for primary schools in the United Kingdom.

4(0.27). In the United States, the term micropolitan statistical area is used.

But when I tried with 2.0.10, the indexing just showed partial logs
jina==2.0.10
(wikisearch) boredmgr@Bikashs-MacBook-Pro wiki-search % python3 app.py -t index
pod0@41147[L]:ready and listening
pod1@41147[L]:ready and listening
gateway@41147[L]:ready and listening
Flow@41147[I]:🎉 Flow is ready to use!
🔗 Protocol: GRPC
🏠 Local access: 0.0.0.0:56459
🔒 Private network: 10.246.245.7:56459
Flow@41147[I]:QPS: indexing 0...
Please type a sentence: Dharmapuri block is a
pod1@41150[E]:AttributeError('score')
add "--quiet-error" to suppress the exception details
Traceback (most recent call last):
File "/Users/boredmgr/opt/anaconda3/envs/wikisearch/lib/python3.9/site-packages/jina/peapods/runtimes/zmq/zed.py", line 313, in _msg_callback
processed_msg = self._callback(msg)
File "/Users/boredmgr/opt/anaconda3/envs/wikisearch/lib/python3.9/site-packages/jina/peapods/runtimes/zmq/zed.py", line 299, in _callback
self._pre_hook(msg)._handle()._post_hook(msg)
File "/Users/boredmgr/opt/anaconda3/envs/wikisearch/lib/python3.9/site-packages/jina/peapods/runtimes/zmq/zed.py", line 245, in _handle
r_docs = self._executor(
File "/Users/boredmgr/opt/anaconda3/envs/wikisearch/lib/python3.9/site-packages/jina/executors/init.py", line 185, in call
return self.requests[req_endpoint](
File "/Users/boredmgr/opt/anaconda3/envs/wikisearch/lib/python3.9/site-packages/jina/executors/decorators.py", line 103, in arg_wrapper
return fn(*args, **kwargs)
File "/Users/boredmgr/jina/examples/wiki-search/indexer.py", line 29, in search
d.score.value = 1 - _dist
File "/Users/boredmgr/opt/anaconda3/envs/wikisearch/lib/python3.9/site-packages/jina/types/document/init.py", line 1343, in getattr
value = dunder_get(self._pb_body, item)
File "/Users/boredmgr/opt/anaconda3/envs/wikisearch/lib/python3.9/site-packages/jina/helper.py", line 1262, in dunder_get
result = getattr(_dict, part1)
AttributeError: score

Hello @bikash119, thank you for your feedback.

With the information you provide, we can't know how you installed dependencies and it is hard to track down you error.

Can you try the following commands to set up a conda environment and execute?
I tested the following code (and it is working):

conda create --name jina_10_wikipedia python=3.8
conda activate jina_10_wikipedia
pip install -r requirements.txt
python app.py -t index 

This issue is being worked on in #697