Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions vllm/transformers_utils/configs/speculators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
class SpeculatorsConfig(PretrainedConfig):
model_type = "speculators"

def __init__(self, **kwargs):
"""PretrainedConfig is a dataclass in Transformers v5.
This pass through is needed to avoid unexpected keyword arguments."""
super().__init__(**kwargs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This fix may be incomplete. If the unexpected keyword argument error is due to PretrainedConfig being a dataclass with a standard generated __init__, that __init__ won't accept arbitrary **kwargs. Consequently, this call to super().__init__(**kwargs) will likely fail with the same error. The keyword arguments should be filtered to pass only those that PretrainedConfig.__init__ accepts. This can be done by inspecting the parent's __init__ signature.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're wrong, but the docstring didn't tell the whole story, I'll improve it.


@classmethod
def from_pretrained(
cls,
Expand Down
Loading