mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
ignore single whitespace at beginning and end of answer, use reward = len(oracle_answer) / len(answer)
This commit is contained in:
parent
979b6ba4ef
commit
0a660a3409
3 changed files with 19 additions and 2 deletions
|
|
@ -17,7 +17,7 @@ Once you have thought about the reasoning process, provide the answer in the fol
|
|||
|
||||
|
||||
def extract_answer(completion: str, tag_name: str = "answer") -> Optional[str]:
|
||||
regex = f"<{tag_name}>(.*?)</{tag_name}>"
|
||||
regex = f"<{tag_name}>\\s?(.*?)\\s?</{tag_name}>"
|
||||
matches = list(
|
||||
re.finditer(
|
||||
regex,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue