Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- 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 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 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)
|