transformers icon indicating copy to clipboard operation
transformers copied to clipboard

[WIP] pass kwargs to config

Open cceyda opened this issue 2 years ago • 4 comments

What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/21757

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.

@sgugger @Narsil PretrainedConfig related

cceyda avatar Feb 23 '23 10:02 cceyda

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

👍 Anyway, wasn't expecting changing something as fundamental as .from_pretrained to be reasonable or easy 😅

@sgugger While working on this I realized a couple of things. Will make separate PRs for them if need be

  • pruned_heads key values should be checked to be type int before casting + error message. there was also a test that used "a" as pruned_head but wasn't failing. will look into why later.
  • Some models' configs use initializer_range some use init_std. For example while FlaubertConfig doesn't have initializer_range but tests in FlaubertModelTester pass initializer_range and not init_std... These keys don't seem to defined int the attribute_map either. So should probably look into those.

Having fun figuring out how from_pretrained magic works

cceyda avatar Feb 24 '23 13:02 cceyda

The pruned head fix is a welcome one. As I've said before (and as you can see from all the failing tests), you cannot change the logic inside the pretrained config like this without breaking many things in the library.

sgugger avatar Feb 27 '23 07:02 sgugger

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Mar 25 '23 15:03 github-actions[bot]