Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config cannot be overwritten through kwargs #59

Closed
bkiat1123 opened this issue May 15, 2023 · 2 comments
Closed

Config cannot be overwritten through kwargs #59

bkiat1123 opened this issue May 15, 2023 · 2 comments

Comments

@bkiat1123
Copy link
Contributor

bkiat1123 commented May 15, 2023

Repro from finetune_adapter script:

from pathlib import Path
from lit_parrot.adapter import Config

max_seq_length = 256  # see scripts/prepare_alpaca.py
checkpoint_dir = Path("checkpoints/togethercomputer/RedPajama-INCITE-Base-3B-v1")
config = Config.from_name(name=checkpoint_dir.name, block_size=max_seq_length)


TypeError: lit_parrot.adapter.Config() got multiple values for keyword argument 'block_size'

https://github.com/Lightning-AI/lit-parrot/blob/0b5620de0c261a69298d39565d6e0f4b1e255fdb/lit_parrot/config.py#L25-L27

We can change it to below so user specified kwargs will overwrite configs.

@classmethod
def from_name(cls, name: str, **kwargs: Any) -> Self:
    return cls(**{**configs[name], **kwargs})
@lantiga
Copy link
Contributor

lantiga commented May 16, 2023

Thank you, pushed a fix in #60

@lantiga
Copy link
Contributor

lantiga commented May 16, 2023

Fixed by #60

@lantiga lantiga closed this as completed May 16, 2023
aniketmaurya pushed a commit to aniketmaurya/install-lit-gpt that referenced this issue Jul 5, 2023
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

No branches or pull requests

2 participants