Experimenting with adding proper get_config() and from_config() methods
Should fix issues with saving/loading Keras models containing Transformers models as layers, among other problems.
It would be ideal to add tests to ensure that the model's serialization works correctly.<|||||>Just a small comment from my side - I think I stumbled across the problem that the returned get_config was not fully JSON serializable (as it contained a reference to a tf DType class) - I circumvented this by adding a custom JSONEncoder for it; but it may be worthwhile testing for json.dumps(config) as well?<|||||>@Zahlii That's a great idea! Would you be willing to write a test for it, or modify the existing test, and tag me for review? <|||||>See https://github.com/huggingface/transformers/pull/14415 