Skip to content

TextArenaEnv.ta_to_hf() crashes when word_list is a dict #1074

@Kannav02

Description

@Kannav02

TextArenaEnv.ta_to_hf() fails when used with TextArena games that return a dict-based word_list , I encounter this while exploring TwentyQuestions-v0. This is the same pattern used by the official Wordle environment on the Hub.

The environment crashes during initialization with a KeyError: 1 inside ta_to_hf().

answer = random.choice(words)
KeyError: 1

I'm assuming this likely affects any TextArena game that uses categorized word lists, not just TwentyQuestions-v0

I'd be happy to open a PR for this fix if that works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions