From 850a7c021bc5567464418418760380f912bd9f25 Mon Sep 17 00:00:00 2001 From: dafnapension Date: Sat, 14 Dec 2024 18:48:49 +0200 Subject: [PATCH] fixed templates settings Signed-off-by: dafnapension --- src/unitxt/standard.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/unitxt/standard.py b/src/unitxt/standard.py index ca396b29c..12efd99a7 100644 --- a/src/unitxt/standard.py +++ b/src/unitxt/standard.py @@ -460,7 +460,7 @@ def reset_pipeline(self): ) else: raise ValueError("num_demos must be int or List[int]") - # here for backward compatibility. to check + if isinstance(self.template, list): self.verbalization.steps.append( ApplyRandomTemplate( @@ -483,16 +483,18 @@ def reset_pipeline(self): ) ) + if isinstance(self.template, list): + self.verbalization.steps.append( + ApplyRandomTemplate(templates=self.template) + ) + else: + self.verbalization.steps.append( + ApplySingleTemplate(template=self.template) + ) + # for backward compatibility, move the refiners here, after demos are taken from train self.prepare_refiners() - if isinstance(self.template, list): - self.verbalization.steps.append( - ApplyRandomTemplate(templates=self.template) - ) - else: - self.verbalization.steps.append(ApplySingleTemplate(template=self.template)) - self.verbalization.steps.append(self.system_prompt) self.verbalization.steps.append(self.format)