Skip to content

Table of Contents

anyGPT.environments.sequence_classification_env

SequenceClassificationEnv Objects

class SequenceClassificationEnv(gym.Env)

__init__

def __init__(
        dataset: str = None,
        render_mode: str = None,
        block_size: int = 2,
        label: str = "clean",
        model_name: str = "madhurjindal/autonlp-Gibberish-Detector-492513457",
        encoded: bool = True,
        device: str = "cpu")

Arguments:

  • dataset: The dataset to sample observations from.
  • render_mode:
  • block_size: The size of the observation string.
  • label: The label to optimize for. Will depend on the HF model loaded.
  • model_name: The name of the HF sequence classifier.
  • encoded: If set to true, observations and actions should be encoded with the proper gpt style tokenizer.