Parthiban007 commited on
Commit
cdc51aa
Β·
verified Β·
1 Parent(s): 8fef615

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. server/rust_coder_environment.py +30 -30
server/rust_coder_environment.py CHANGED
@@ -235,36 +235,36 @@ class RustCoderEnvironment(Environment):
235
  )
236
 
237
  if not code.strip():
238
- # Invalid/empty submission: do not advance the problem index.
239
- self._logger.warning(
240
- "Empty code submitted step_count=%d problem_id=%s title=%s",
241
- self.step_count,
242
- problem.get("id"),
243
- problem.get("title"),
244
- )
245
- self._dbg(
246
- "H1",
247
- "server/rust_coder_environment.py:step:empty",
248
- "empty code branch taken",
249
- {"step_count": self.step_count, "problem_id": problem.get("id")},
250
- )
251
- done = False
252
- return RustCoderObservation(
253
- problem_description=problem["description"],
254
- starter_code=problem.get("starter_code", ""),
255
- compilation_success=False,
256
- compilation_output="Error: no code submitted.",
257
- test_results=[],
258
- reward_breakdown={
259
- "compilation": 0.0,
260
- "correctness": 0.0,
261
- "coverage": 0.0,
262
- "elegance": 0.0,
263
- "efficiency": 0.0,
264
- },
265
- done=done,
266
- reward=0.0,
267
- )
268
 
269
  # ── 1. Compilation (40%) ──────────────────────────────────────
270
  compilation_success, compilation_output = self._compile_check(code)
 
235
  )
236
 
237
  if not code.strip():
238
+ # Invalid/empty submission: do not advance the problem index.
239
+ self._logger.warning(
240
+ "Empty code submitted step_count=%d problem_id=%s title=%s",
241
+ self.step_count,
242
+ problem.get("id"),
243
+ problem.get("title"),
244
+ )
245
+ self._dbg(
246
+ "H1",
247
+ "server/rust_coder_environment.py:step:empty",
248
+ "empty code branch taken",
249
+ {"step_count": self.step_count, "problem_id": problem.get("id")},
250
+ )
251
+ done = False
252
+ return RustCoderObservation(
253
+ problem_description=problem["description"],
254
+ starter_code=problem.get("starter_code", ""),
255
+ compilation_success=False,
256
+ compilation_output="Error: no code submitted.",
257
+ test_results=[],
258
+ reward_breakdown={
259
+ "compilation": 0.0,
260
+ "correctness": 0.0,
261
+ "coverage": 0.0,
262
+ "elegance": 0.0,
263
+ "efficiency": 0.0,
264
+ },
265
+ done=done,
266
+ reward=0.0,
267
+ )
268
 
269
  # ── 1. Compilation (40%) ──────────────────────────────────────
270
  compilation_success, compilation_output = self._compile_check(code)