Skip to content

fix: close the code fence in the LiveCodeBench prompt template - #16

Open
koriyoshi2041 wants to merge 1 commit into
Gen-Verse:mainfrom
koriyoshi2041:fix/lcb-prompt-unclosed-code-fence
Open

fix: close the code fence in the LiveCodeBench prompt template#16
koriyoshi2041 wants to merge 1 commit into
Gen-Verse:mainfrom
koriyoshi2041:fix/lcb-prompt-unclosed-code-fence

Conversation

@koriyoshi2041

Copy link
Copy Markdown

In recipe/demystify/reward.py, map_lcb builds the LiveCodeBench prompt with code_prompt, which opens a ```python fence but terminates the string with a stray " instead of the closing ```:

code_prompt = "...STDOUT.\n```python\n# YOUR CODE HERE\n\""

So the prompt sent to the model ends with an unterminated code block and a dangling ". The continuation used a few lines below (and the commented-out code_agent_prompt) close the fence correctly with ```..

This adds the missing ``` so the example block shown to the model is well-formed:

code_prompt = "...STDOUT.\n```python\n# YOUR CODE HERE\n```"

Verified the module still imports (py_compile) and the rendered string now ends with a closed code fence.

map_lcb's code_prompt opened a ```python fence but ended the string with a
stray double quote instead of the closing ```, so the prompt shown to the
model contained an unterminated code block plus a trailing ". The sibling
prompts (and the commented-out template above) close the fence correctly.
Add the missing ``` so the example block is well-formed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant