|
@ -20,25 +20,39 @@ |
|
|
from towhee import AutoPipes, AutoConfig |
|
|
from towhee import AutoPipes, AutoConfig |
|
|
|
|
|
|
|
|
config = AutoConfig.load_config('eqa-search') |
|
|
config = AutoConfig.load_config('eqa-search') |
|
|
config.openai_api_key = [your-openai-api-key] |
|
|
|
|
|
|
|
|
config.host = '127.0.0.1' |
|
|
|
|
|
config.port = '19530' |
|
|
config.collection_name = 'chatbot' |
|
|
config.collection_name = 'chatbot' |
|
|
|
|
|
config.top_k = 5 |
|
|
|
|
|
|
|
|
|
|
|
# If using zilliz cloud |
|
|
|
|
|
config.user = [zilliz-cloud-username] |
|
|
|
|
|
config.password = [zilliz-cloud-password] |
|
|
|
|
|
|
|
|
|
|
|
# OpenAI api key |
|
|
|
|
|
config.openai_api_key = [your-openai-api-key] |
|
|
|
|
|
# Embedding model |
|
|
|
|
|
config.embedding_model = 'all-MiniLM-L6-v2' |
|
|
|
|
|
# Embedding model device |
|
|
|
|
|
config.embedding_device = -1 |
|
|
|
|
|
|
|
|
|
|
|
# The threshold to filter milvus search result |
|
|
|
|
|
config.threshold = 0.5 |
|
|
|
|
|
|
|
|
# The llm model source, openai or dolly |
|
|
# The llm model source, openai or dolly |
|
|
config.llm_src = 'openai' |
|
|
config.llm_src = 'openai' |
|
|
# The llm model name |
|
|
# The llm model name |
|
|
config.llm_model = 'gpt-3.5-turbo' |
|
|
config.llm_model = 'gpt-3.5-turbo' |
|
|
# The threshold to filter milvus search result |
|
|
|
|
|
config.threshold = 0.5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p = AutoPipes.pipeline('eqa-search', config=config) |
|
|
p = AutoPipes.pipeline('eqa-search', config=config) |
|
|
res = p('https://github.com/towhee-io/towhee/blob/main/README.md', []) |
|
|
|
|
|
|
|
|
res = p('What is towhee?', []) |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br /> |
|
|
<br /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Enhanced QA Search Config |
|
|
## Enhanced QA Search Config |
|
|
|
|
|
|
|
|
### Configuration for Sentence Embedding |
|
|
### Configuration for Sentence Embedding |
|
|