Skip to content

Commit

Permalink
Add newline as a special value for AddToStopRunExpander (#2584)
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanmai authored Apr 23, 2024
1 parent 37edfbf commit 6059b65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/helm/benchmark/run_expander.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,16 @@ def __init__(self, value):
self.value = value

def expand(self, run_spec: RunSpec) -> List[RunSpec]:
if self.value == "newline":
stop_sequence = "\n"
else:
stop_sequence = self.value
return [
replace(
run_spec,
name=run_spec.name,
adapter_spec=replace(
run_spec.adapter_spec, stop_sequences=run_spec.adapter_spec.stop_sequences + [self.value]
run_spec.adapter_spec, stop_sequences=run_spec.adapter_spec.stop_sequences + [stop_sequence]
),
),
]
Expand Down

0 comments on commit 6059b65

Please sign in to comment.