fix: handle dict word_list in TextArenaEnv.ta_to_hf() + add Supported Patterns docs#1147
Open
vominh1919 wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
Open
fix: handle dict word_list in TextArenaEnv.ta_to_hf() + add Supported Patterns docs#1147vominh1919 wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
vominh1919 wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
Conversation
Author
|
Hi! I'd like to help with this issue. I can analyze the problem and create a fix. Here's my approach:
Would you like me to proceed? Offering help with open issues to improve the project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
1. Fix TextArenaEnv.ta_to_hf() crash with dict word_list (Fixes #1074)
The
ta_to_hf()method crashed withKeyError: 1whenword_listwas a dict (e.g., TwentyQuestions-v0). This happened becauserandom.choice(words)returned a dict key instead of a word.Fix: Added check to flatten dict word_list into a list before random selection.
2. Add "Supported Patterns" section to README (Addresses #1078)
Added comprehensive documentation of supported RL framework design patterns to the README, covering:
This makes the design space more discoverable for new users.
Testing
Closes #1074
Closes #1078
Note
Low Risk
Small, localized bug fix to dataset generation plus documentation-only additions; no security-sensitive or broad behavioral changes.
Overview
Fixes a crash in
TextArenaEnv.ta_to_hf()when TextArena providesword_listas a dict (e.g., category -> words) by flattening it beforerandom.choice, ensuring dataset generation works across game types.Updates
README.mdwith a new Supported Patterns section that summarizes the library’s out-of-the-box RL environment/harness capabilities (context management, tool parsing, sandboxing modes, reward composition, multi-env evals, resource management, and offline eval tooling).Reviewed by Cursor Bugbot for commit fba8562. Bugbot is set up for automated code reviews on this repo. Configure here.