mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
strip answer and solution
This commit is contained in:
parent
3f98afe47d
commit
beb509b6f6
1 changed files with 2 additions and 1 deletions
|
|
@ -53,9 +53,10 @@ class ProceduralDataset(ABC, Sized, Iterable[Dict[str, Any]]):
|
|||
|
||||
def score_answer(self, answer: Optional[str], entry: Dict[str, any]) -> float:
|
||||
"""Overwrite this method in derived classes if a single oracle answer is not available."""
|
||||
oracle_answer = entry["answer"]
|
||||
oracle_answer = entry["answer"].strip()
|
||||
reward = 0.0
|
||||
if answer is not None and len(answer) > 0:
|
||||
answer = answer.strip()
|
||||
if answer == oracle_answer:
|
||||
reward = 1.0
|
||||
elif oracle_answer in answer:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue