Skip to content
Permalink
Browse files

feat(flow): add index and query flow as common flow

  • Loading branch information...
hanxiao committed Oct 15, 2019
1 parent c324e3d commit 166698ce254bf0ad5f28612707def93428e7da83
Showing with 6 additions and 3 deletions.
  1. +6 −3 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.
You can’t perform that action at this time.