"vscode:/vscode.git/clone" did not exist on "c7c3415a00b1afa683053ad6c04a5e01e99bc25b"
Unverified Commit e5d96dc8 authored by Harry Mellor's avatar Harry Mellor Committed by GitHub
Browse files

Fix `SpeculatorsConfig` now that `PreTrainedConfig` is a `dataclass` in Transformers (#37574)


Signed-off-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
parent daa05bf3
...@@ -14,6 +14,13 @@ from vllm.transformers_utils.utils import without_trust_remote_code ...@@ -14,6 +14,13 @@ from vllm.transformers_utils.utils import without_trust_remote_code
class SpeculatorsConfig(PretrainedConfig): class SpeculatorsConfig(PretrainedConfig):
model_type = "speculators" model_type = "speculators"
def __init__(self, **kwargs):
"""In Transformers v5, `PretrainedConfig` is decorated with `dataclass` and
`huggingface_hub.dataclasses.strict(accept_kwargs=True)`.
Inheriting classes do not inherit the `accept_kwargs=True` behaviour so we must
explicitly pass any kwargs to `PretrainedConfig.__init__`."""
super().__init__(**kwargs)
@classmethod @classmethod
def from_pretrained( def from_pretrained(
cls, cls,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment