transformers
transformers copied to clipboard
Adding variant as a keyword to config.save_pretrained
What does this PR do?
When saving a model of type PreTrainedModel
via save_pretrained
you can add a variant argument so that the final model name can be model.vision.safetensors
or model.text.safetensors
. However, this capability is not extended to configuration files. This is a PR to add this capability
Fixes # (issue) If in a file you do the following, you only get one configuration file with the last config
vision_model.save_pretrained(save_directory, variant="vision")
text_model.save_pretrained(save_directory, variant="text")
Note: Tests are failing. Will fix those issues if this PR is useful in the first place. Please let me know if this PR will be accepted if I fix the rest of the tests.
Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the contributor guideline, Pull Request section?
- [x] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
- [x] Did you write any new necessary tests?
cc @fxmarty
Hey @sachinruk, can you walk me through what use case that would enable?
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.