From 6e690dd2064d9cfa6b00bbc7365ceab35407f247 Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Tue, 30 May 2023 17:52:45 +0800 Subject: [PATCH] Remove question from history for Dolly Signed-off-by: Jael Gu --- hf_dolly.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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