Skip to content

Commit

Permalink
fixed templates settings
Browse files Browse the repository at this point in the history
Signed-off-by: dafnapension <[email protected]>
  • Loading branch information
dafnapension committed Dec 14, 2024
1 parent 7329c79 commit 850a7c0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/unitxt/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)

Expand Down

0 comments on commit 850a7c0

Please sign in to comment.