logo
Dolly
repo-copy-icon

copied

Browse Source

Update README

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 1 year ago
parent
commit
b4a6d24315
  1. 17
      README.md

17
README.md

@ -1,4 +1,4 @@
# OpenAI Chat Completion
# Dolly Generation
*author: Jael*
@ -22,16 +22,15 @@ Use the default model to continue the conversation from given messages.
from towhee import pipe, ops
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 />

Loading…
Cancel
Save