Conversation
|
maybe also need to fix https://github.com/evalplus/evalplus/blob/master/tools/mbpp/to_original_fmt.py |
I think it's not necessary to modify. This PR merely adds two additional valid solutions, while the original |
|
I have tested this on EvalPlus, and this modification does not affect other |
Because now we added special oracles, we should also reflect such oracles when exporting them to original formats, just like: evalplus/tools/humaneval/to_original_fmt.py Lines 82 to 85 in d4981ad |
|
I see. # test 581
exec_code_0 = """\
def surface_Area(base, height):
return (base * base) + (2 * base * height)
"""
exec_code_1 = """\
import math
def surface_Area(base_edge, height):
slant_height = math.sqrt((base_edge / 2) ** 2 + height ** 2)
base_area = base_edge ** 2
lateral_area = 4 * (base_edge * slant_height) / 2
total_surface_area = base_area + lateral_area
return round(total_surface_area)
"""
exec(exec_code_0+data[581]['test'], globals())
exec(exec_code_1+data[581]['test'], globals())
# test 558
exec_code_0 = """\
def digit_distance_nums(n1, n2):
return sum([abs(int(c1) - int(c2)) for c1, c2 in zip(str(n1), str(n2))])
"""
exec_code_1 = """\
def digit_distance_nums(num1: int, num2: int) -> int:
str_num1 = str(num1)
str_num2 = str(num2)
max_length = max(len(str_num1), len(str_num2))
padded_num1 = str_num1.zfill(max_length)
padded_num2 = str_num2.zfill(max_length)
return sum(abs(int(digit1) - int(digit2)) for digit1, digit2 in zip(padded_num1, padded_num2))
"""
exec(exec_code_0+data[558]['test'], globals())
exec(exec_code_1+data[558]['test'], globals()) |
fix #210
Add special oracles for
They have more than one solutions which could be accepted.
base_inputandplus_input