Skip to content

[Bug] TypeError: SFTConfig.__init__() got an unexpected keyword argument 'max_seq_length' #8762

@jtourille

Description

@jtourille

What happened?

I am trying to use the BootstrapFinetune optimizer using a local Gemma 3 via SGLang, by following the tutorial on the DSPy website. Since I want to use Gemma 3, I need a recent version of transformers, so I do not pinpoint any version.

Looking at trl source code, it seems that the keyword max_seq_length in the SFTConfig class has been abandonned since the 0.16.0 version (last version is 0.22.2, which is the one installed in my case).

Is there any tutorial somewhere that has been recently tested ?

Steps to reproduce

My current environment was built as presented below.

$ uv venv --python=3.11
$ uv pip install dspy
$ uv pip install "sglang[all]"
$ uv pip install transformers accelerate trl peft

DSPy version

3.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions