logo
Browse Source

Update README

main
shiyu22 11 months ago
parent
commit
30ce95b715
  1. 4
      README.md

4
README.md

@ -21,7 +21,7 @@ from towhee import pipe, ops, DataCollection
p = pipe.input('collection_name', 'text') \
.map('text', 'vec', ops.sentence_embedding.transformers(model_name='all-MiniLM-L12-v2')) \
.flat_map(('collection_name', 'vec'), 'rows', ops.ann_search.milvus_client(host='127.0.0.1', port='19530', **{'output_fields': ['text']})) \
.map(('collection_name', 'vec'), 'rows', ops.ann_search.osschat_milvus(host='127.0.0.1', port='19530', **{'output_fields': ['text']})) \
.map('rows', ('id', 'score', 'text'), lambda x: (x[0], x[1], x[2])) \
.output('id', 'score', 'text')
@ -39,7 +39,7 @@ from towhee import pipe, ops, DataCollection
p = pipe.input('collection_name', 'text') \
.map('text', 'vec', ops.sentence_embedding.transformers(model_name='all-MiniLM-L12-v2')) \
.map(('collection_name', 'vec'), 'rows', ops.ann_search.milvus_client(host='127.0.0.1', port='19530', **{'output_fields': ['text']})) \
.map(('collection_name', 'vec'), 'rows', ops.ann_search.osschat_milvus(host='127.0.0.1', port='19530', **{'output_fields': ['text']})) \
.output('rows')
DataCollection(p('test_collection', 'cat')).show()

Loading…
Cancel
Save