om192006 commited on
Commit
81e9298
·
verified ·
1 Parent(s): 6dfde14

Upload folder using huggingface_hub

Browse files
inference.py CHANGED
@@ -210,6 +210,7 @@ async def run_task(task_id: str, client: OpenAI) -> float:
210
  result = await env.step(action)
211
  obs = result.observation
212
  reward = result.reward or 0.0
 
213
  done = result.done
214
 
215
  rewards.append(reward)
@@ -227,14 +228,14 @@ async def run_task(task_id: str, client: OpenAI) -> float:
227
  break
228
 
229
  score = reward # single step episode, reward IS the score
230
- score = min(max(score, 0.0), 1.0)
231
  success = score >= SUCCESS_THRESHOLD
232
 
233
  except Exception as exc:
234
  print(f"[DEBUG] Task '{task_id}' failed: {exc}", flush=True)
235
- score = 0.0
236
  success = False
237
- rewards = [0.0]
238
  steps_taken = 0
239
 
240
  finally:
@@ -267,7 +268,7 @@ async def main() -> None:
267
 
268
  # Final summary
269
  total_score = sum(all_scores) / len(all_scores)
270
- total_score = min(max(total_score, 0.0), 1.0)
271
 
272
  print("\n" + "="*60, flush=True)
273
  print(" FINAL RESULTS", flush=True)
 
210
  result = await env.step(action)
211
  obs = result.observation
212
  reward = result.reward or 0.0
213
+ reward = min(max(reward, 0.01), 0.99)
214
  done = result.done
215
 
216
  rewards.append(reward)
 
228
  break
229
 
230
  score = reward # single step episode, reward IS the score
231
+ score = min(max(score, 0.01), 0.99)
232
  success = score >= SUCCESS_THRESHOLD
233
 
234
  except Exception as exc:
235
  print(f"[DEBUG] Task '{task_id}' failed: {exc}", flush=True)
236
+ score = 0.01
237
  success = False
238
+ rewards = [0.01]
239
  steps_taken = 0
240
 
241
  finally:
 
268
 
269
  # Final summary
270
  total_score = sum(all_scores) / len(all_scores)
271
+ total_score = min(max(total_score, 0.01), 0.99)
272
 
273
  print("\n" + "="*60, flush=True)
274
  print(" FINAL RESULTS", flush=True)
server/github_issue_triage_environment.py CHANGED
@@ -283,6 +283,7 @@ def grade_action(
283
  f"(+{action_score * 0.2:.2f})."
284
  )
285
 
 
286
  return round(reward, 4), " | ".join(feedback_parts)
287
 
288
 
 
283
  f"(+{action_score * 0.2:.2f})."
284
  )
285
 
286
+ reward = max(0.01, min(0.99, reward))
287
  return round(reward, 4), " | ".join(feedback_parts)
288
 
289