Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdai committed Sep 21, 2024
1 parent 016975e commit 4573d63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
7 changes: 3 additions & 4 deletions arc_finetuning_st/workflows/arc_task_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ def __init__(self, llm: LLM, max_attempts: int = 3, **kwargs: Any) -> None:
self.llm = llm
self._max_attempts = max_attempts

@staticmethod
def _format_past_attempt(attempt: Attempt, attempt_num: int) -> str:
def _format_past_attempt(self, attempt: Attempt, attempt_num: int) -> str:
return past_attempt_template.format(
past_attempt_number=attempt_num,
past_predicted_output=str(attempt.prediction),
Expand Down Expand Up @@ -90,7 +89,7 @@ def format_train_example(train_pair: Dict) -> str:
# update past predictions
prompt_vars = await ctx.get("prompt_vars")
formatted_past_attempts = [
ARCTaskSolverWorkflow._format_past_attempt(a, ix + 1)
self._format_past_attempt(a, ix + 1)
for ix, a in enumerate(attempts)
]
prompt_vars.update(
Expand Down Expand Up @@ -159,7 +158,7 @@ async def reflection(self, ctx: Context, ev: EvaluationEvent) -> StopEvent:
if not ev.passing:
prompt_vars = await ctx.get("prompt_vars")
formatted_past_attempts = [
ARCTaskSolverWorkflow._format_past_attempt(a, ix + 1)
self._format_past_attempt(a, ix + 1)
for ix, a in enumerate(attempts)
]
prompt_vars.update(
Expand Down
22 changes: 0 additions & 22 deletions arc_finetuning_st/workflows/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,3 @@
Return your response in JSON format given above. DO NOT RETURN markdown code."""
)

FINETUNING_DATASET_EXAMPLE_TEMPLATE = """You are a bot that is very good at solving puzzles. Below is a list of input and output pairs that share a
common pattern. The TEST INPUT also shares this common pattern, and you've previously predicted the output for it.
The predicted output was found to be incorrect and a critique has been articulated offering a potential
reason as to why it may have been a flawed prediction.
Your task now to create a new prediction that corrects from the previous attempts. Use the last attempt and critique.
EXAMPLES:
{examples}
TEST INPUT:
{test_input}
PAST ATTEMPTS:
{past_attempts}
Return your response in JSON format given above. DO NOT RETURN markdown code.
OUTPUT:
{output}
"""

0 comments on commit 4573d63

Please sign in to comment.