-
Notifications
You must be signed in to change notification settings - Fork 131
validation check added #1407
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
base: main
Are you sure you want to change the base?
validation check added #1407
Conversation
👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review. Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ved1beta ! Could you provide more context as to when this code would be useful?
I also see here that valid_fields
is undeclared in some cases, you may want to make sure that that variable is declared in all cases, or make explicit the assumption that all modifiers have model fields
validation check useful when is writing recipes for modifiers. The specific issue being fixed (issue #1226) occurs when users specify invalid or irrelevant arguments in a modifier's configuration. Without this validation, the system silently accepts invalid arguments, which can lead to several issues. Eg |
@ved1beta I see! Have you explored Pydantic's extra="forbid" option at all? class Model(BaseModel):
x: int
model_config = ConfigDict(extra="forbid") |
Sorry, I was actually referencing adding the forbid option directly to the |
I was actually suggesting to add the extra forbid config to the Modifier class, directly. This solution also covers cases where users create modifiers directly, rather than going through the ModifierFactory |
SUMMARY:
added a validation check in create_modifier
fixes #1226