[NOT MEANT TO MERG!] GRPO reward func for coding dataset #105
+109
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
refer to #28
This is an example of how to use the OpenCoders dataset to create a reward function for the
GRPOTrainer
. The reward function parses the generated code, creates an evaluation script, and executes it using E2B to calculate its accuracy by counting the number of test cases that passed, as well as measuring the execution time.It's not perfect since there are edge cases and potential failures that have not been addressed.
I haven't been able to test it with GRPO due to other issues. I would appreciate it if anyone could try this out and see if there are any other issues or if it works properly.
A similar approach was used to train R1, although it likely relied solely on a LeetCode dataset.