diff --git a/hf_dolly.py b/hf_dolly.py index b272c1e..fd091c0 100644 --- a/hf_dolly.py +++ b/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