Browse Source
Remove question from history for Dolly
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
1 changed files with
3 additions and
2 deletions
-
hf_dolly.py
|
|
@ -43,8 +43,9 @@ class HuggingfaceDolly(PyOperator): |
|
|
|
prompt = messages[-1]['question'] |
|
|
|
history = '' |
|
|
|
for m in messages[:-1]: |
|
|
|
for _, v in m.items(): |
|
|
|
history += v + '\n' |
|
|
|
for k, v in m.items(): |
|
|
|
if k == 'answer': |
|
|
|
history += v + '\n' |
|
|
|
return prompt + '\n' + history |
|
|
|
|
|
|
|
|
|
|
|