Skip to content

fix(copro): make eval_kwargs parameter truly optional#9290

Open
themavik wants to merge 1 commit intostanfordnlp:mainfrom
themavik:fix/copro-eval-kwargs-optional
Open

fix(copro): make eval_kwargs parameter truly optional#9290
themavik wants to merge 1 commit intostanfordnlp:mainfrom
themavik:fix/copro-eval-kwargs-optional

Conversation

@themavik
Copy link

Summary

Fixes #9080

The COPRO.compile() method documents eval_kwargs as an optional parameter, but the implementation requires it as a mandatory keyword-only argument. Calling compile() without eval_kwargs raises a TypeError.

Changes

  • Changed eval_kwargs default from no-default to None in compile() signature
  • Added or {} guard when unpacking eval_kwargs to safely handle None

Before

# TypeError: compile() missing 1 required keyword-only argument: 'eval_kwargs'
compiled = teleprompter.compile(program, trainset=trainset)

After

# Works — eval_kwargs defaults to None, unpacks as empty dict
compiled = teleprompter.compile(program, trainset=trainset)

# Still works with explicit kwargs
compiled = teleprompter.compile(program, trainset=trainset, eval_kwargs={"num_threads": 4})

Made with Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] COPRO implementation does not have optional eval_kwargs

1 participant

Comments