mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-22 16:49:06 +00:00
add ArcAgiDataset class, fix score_entry() metadata params
This commit is contained in:
parent
2ad0965fdc
commit
4e49806d22
20 changed files with 194 additions and 93 deletions
|
|
@ -1,6 +1,16 @@
|
|||
from dataclasses import dataclass, field
|
||||
from typing import List, Tuple
|
||||
|
||||
ARC_PROMPT_TEMPLATE = """Find the common rule that maps an input grid to an output grid, given the examples below.
|
||||
|
||||
{examples}
|
||||
Below is a test input grid. Predict the corresponding output grid by applying the rule you found.
|
||||
Your final answer should just be the text output grid itself.
|
||||
|
||||
Input:
|
||||
{input_grid}
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
class BoardFormattingOptions:
|
||||
|
|
@ -10,26 +20,6 @@ class BoardFormattingOptions:
|
|||
array_brackets: bool = False
|
||||
|
||||
|
||||
def format_arc_task(
|
||||
input_grid: Tuple[Tuple[int, ...], ...], output_grid: Tuple[Tuple[int, ...], ...], options: BoardFormattingOptions
|
||||
) -> str:
|
||||
"""
|
||||
Format an ARC task as a string
|
||||
"""
|
||||
|
||||
buffer = []
|
||||
if options.task_identifier:
|
||||
buffer.append(f"ARC Task: {options.task_identifier}")
|
||||
|
||||
buffer.append("\nInput Grid:")
|
||||
buffer.append(format_board(input_grid, options))
|
||||
|
||||
buffer.append("\n\nOutput Grid:")
|
||||
buffer.append(format_board(output_grid, options))
|
||||
|
||||
return "\n".join(buffer)
|
||||
|
||||
|
||||
def format_board(
|
||||
board: List[List[int]], formatting_options: BoardFormattingOptions, with_board_shape: bool = False
|
||||
) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue