fix for amazon_polarity where answers have a newline first

This commit is contained in:
deep1
2023-09-11 06:45:05 +08:00
parent 48a6062c2d
commit 725dcdcec9
+1 -1
View File
@@ -226,7 +226,7 @@ def _convert_to_prompts(
fewshot_examples = next(fewshot_iter)
if instructed_to_lie: fewshot_examples = [{**e, 'label': ~e['label']} for e in fewshot_examples]
fewshot_texts = [
dict(user=q, response=a) for q, a in map(template.apply, fewshot_examples)
dict(user=q, response=a.strip()) for q, a in map(template.apply, fewshot_examples)
]
prompt_parts = fewshot_texts + prompt_parts