[Python] TypeError: PPOTrainer.__init__() got an unexpected keyword argument 'config'

Discussão em 'Python' iniciado por Stack, Agosto 6, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to initialize a PPO_trainer but have issues.

    from trl import PPOTrainer, PPOConfig

    ppo_config = PPOConfig(
    batch_size=4,
    learning_rate=1e-5,
    mini_batch_size=2,
    use_cpu=True
    )

    ppo_trainer = PPOTrainer(
    config=ppo_config,
    model=model,
    tokenizer=tokenizer,
    train_dataset=dataset,
    )


    And keep getting all kinds of errors regarding the arguments, but the most common one is TypeError: PPOTrainer.__init__() got an unexpected keyword argument 'config'

    I am using trl==0.4.7.

    Thanks.

    Continue reading...

Compartilhe esta Página