44import os
55import random
66import threading
7- < << << << HEAD
8- == == == =
97from typing import cast
10- > >> >> >> f7aaf55d (License & Readme & remove front & CICD etc .)
118
129import aiohttp
1310from openai import AsyncOpenAI
@@ -131,13 +128,8 @@ async def get_reward(self, instance, solution_str, session=None):
131128 'task' : task ,
132129 },
133130 ) as response :
134- < << << << HEAD
135- response_json = await response .json ()
136- res = response_json ['score' ]
137- == == == =
138131 result = await response .json ()
139132 res = result ['score' ]
140- > >> >> >> f7aaf55d (License & Readme & remove front & CICD etc .)
141133 except Exception as e :
142134 logger .error (f'Error: { e } , ip: { ip } ' )
143135 logger .info (
@@ -156,13 +148,8 @@ async def get_reward(self, instance, solution_str, session=None):
156148 'data_source' : data_source ,
157149 },
158150 ) as response :
159- << << << < HEAD
160- response_json = await response .json ()
161- res = response_json ['score' ]
162- == == == =
163151 result = await response .json ()
164152 res = result ['score' ]
165- >> >> >> > f7aaf55d (License & Readme & remove front & CICD etc .)
166153 except Exception as e :
167154 logger .error (f'Error: { e } , ip: { ip } ' )
168155 logger .info (
@@ -177,14 +164,6 @@ async def get_reward(self, instance, solution_str, session=None):
177164
178165 # TODO: add llm_as_judge reward
179166
180- < << << << HEAD
181- # Convert res to float score
182- if isinstance (res , (int , float , bool )):
183- score = float (res )
184- else :
185- raise ValueError (f'Invalid reward type: { type (res )} ' )
186- == == == =
187167 score = float (res )
188- >> >> >> > f7aaf55d (License & Readme & remove front & CICD etc .)
189168
190- return {'resolved' : score > 0.99 , 'reward' : score }
169+ return {'resolved' : score > 0.99 , 'reward' : score }
0 commit comments