Skip to content

Conversation

@ArneBinder
Copy link
Owner

@ArneBinder ArneBinder commented Mar 27, 2025

With this PR, it is now possible to overwrite individual config entries that are arbitrarily nested. Does work for dicts, but not for lists.

This also adds the parameter config_override to _from_pretrained and _from_config to provide fine-grained control over this behavior. It accepts a bool value or a dict mapping from config keys to bool or dict values again, this can be recursive. If True, the value for the respective key (or the whole config, on the top level) is taken from the keyword arguments. If False, the keyword argument is discarded and the respective config value is taken. If it is None or if no bool value is set for the respective key, the keyword arguments are merged recursively into the config.

TODO:

  • test in downstream setup

@ArneBinder ArneBinder merged commit 3aad73c into main Mar 29, 2025
6 checks passed
@ArneBinder ArneBinder deleted the from_pretrained_and_config_update_nested branch March 29, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants