jina-ai / executors

internal-only
Apache License 2.0
31 stars 12 forks source link

Indexer crashes on empty dump file #80

Open florian-hoenicke opened 3 years ago

florian-hoenicke commented 3 years ago

If there is no data in the dump, the annoy indexer crashes.

Please chose a more user friendly solution: Either do:

logs:

Traceback (most recent call last):
   File "/usr/local/lib/python3.7/site-packages/jina/peapods/runtimes/request_handlers/data_request_handler.py", line 85, in _load_executor
     runtime_args=vars(self.args),
   File "/usr/local/lib/python3.7/site-packages/jina/jaml/__init__.py", line 556, in load_config
     return JAML.load(tag_yml, substitute=False)
   File "/usr/local/lib/python3.7/site-packages/jina/jaml/__init__.py", line 90, in load
     r = yaml.load(stream, Loader=JinaLoader)
   File "/usr/local/lib/python3.7/site-packages/yaml/__init__.py", line 114, in load
     return loader.get_single_data()
   File "/usr/local/lib/python3.7/site-packages/yaml/constructor.py", line 51, in get_single_data
     return self.construct_document(node)
   File "/usr/local/lib/python3.7/site-packages/yaml/constructor.py", line 55, in construct_document
     data = self.construct_object(node)
   File "/usr/local/lib/python3.7/site-packages/yaml/constructor.py", line 100, in construct_object
     data = constructor(self, node)
   File "/usr/local/lib/python3.7/site-packages/jina/jaml/__init__.py", line 427, in _from_yaml
     return get_parser(cls, version=data.get('version', None)).parse(cls, data)
   File "/usr/local/lib/python3.7/site-packages/jina/jaml/parsers/executor/legacy.py", line 73, in parse
     runtime_args=data.get('runtime_args', {}),
   File "/workspace/annoy_searcher.py", line 59, in __init__
     num_dim = self._vecs.shape[1]
tadejsv commented 3 years ago

What indexer is this?

florian-hoenicke commented 3 years ago

annoy