Browse Source
Update README
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
1 changed files with
8 additions and
9 deletions
-
README.md
|
@ -1,4 +1,4 @@ |
|
|
# OpenAI Chat Completion |
|
|
|
|
|
|
|
|
# Dolly Generation |
|
|
|
|
|
|
|
|
*author: Jael* |
|
|
*author: Jael* |
|
|
|
|
|
|
|
@ -22,16 +22,15 @@ Use the default model to continue the conversation from given messages. |
|
|
from towhee import pipe, ops |
|
|
from towhee import pipe, ops |
|
|
|
|
|
|
|
|
p = ( |
|
|
p = ( |
|
|
pipe.input('messages') |
|
|
|
|
|
.map('messages', 'answer', ops.LLM.Dolly()) |
|
|
|
|
|
.output('messages', 'answer') |
|
|
|
|
|
|
|
|
pipe.input('question', 'docs', 'history') |
|
|
|
|
|
.map(('question', 'docs', 'history'), 'prompt', ops.prompt.question_answer(llm_name='dolly')) |
|
|
|
|
|
.map('prompt', 'answer', ops.LLM.Dolly()) |
|
|
|
|
|
.output('answer') |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
messages=[ |
|
|
|
|
|
{'question': 'Who won the world series in 2020?', 'answer': 'The Los Angeles Dodgers won the World Series in 2020.'}, |
|
|
|
|
|
{'question': 'Where was it played?'} |
|
|
|
|
|
] |
|
|
|
|
|
answer = p(messages) |
|
|
|
|
|
|
|
|
history=[('Who won the world series in 2020?', 'The Los Angeles Dodgers won the World Series in 2020.')] |
|
|
|
|
|
question = 'Where was it played?' |
|
|
|
|
|
answer = p(question, [], history) |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
<br /> |
|
|
<br /> |
|
|