Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
feat(flow): add index and query flow as common flow
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Oct 15, 2019
1 parent c324e3d commit 166698c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gnes/flow/common.py
@@ -1,16 +1,19 @@
from . import Flow

# these base flow define common topology in real world
# however, they are not usable directly unless you set the correct `yaml_path`

BaseIndexFlow = (Flow()
.add_preprocessor(name='prep', yaml_path='BasePreprocessor')
.add_encoder(yaml_path='BaseEncoder')
.add_encoder(name='enc', yaml_path='BaseEncoder')
.add_indexer(name='vec_idx', yaml_path='BaseIndexer')
.add_indexer(name='doc_idx', yaml_path='BaseIndexer', recv_from='prep')
.add_router(name='sync_barrier', yaml_path='BaseReduceRouter',
.add_router(name='sync', yaml_path='BaseReduceRouter',
num_part=2, recv_from=['vec_idx', 'doc_idx']))

BaseQueryFlow = (Flow()
.add_preprocessor(name='prep', yaml_path='BasePreprocessor')
.add_encoder(yaml_path='BaseEncoder')
.add_encoder(name='enc', yaml_path='BaseEncoder')
.add_indexer(name='vec_idx', yaml_path='BaseIndexer')
.add_router(name='scorer', yaml_path='Chunk2DocTopkReducer')
.add_indexer(name='doc_idx', yaml_path='BaseIndexer'))

0 comments on commit 166698c

Please sign in to comment.