Calling changed functions in transformers/training_args

I am maintaining a program that used to do things like
TrainingArguments.to_json_string(my_object) and TrainingArguments.to_sanitized_dict(my_object).

But in the latest version of transformers/training_args (v4.8.2), these two functions do not take arguments anymore. Instead, they act on ‘self’, which is a TrainingArgument object: to_json_string(self) and to_sanitized_dict(self) -> Dict[str, Any].

Therefore, I wonder how do I change my implementation accordingly in order to make the same functionality works. Copying functions from transformers/training_args to my object class solves part of the issue, but works bad when the function has dependencies on other things in transformers/training_args, and it doesn’t make a lot of sense to copy everything from the transformers/training_args file to my object class.

What is the best way of doing this? Thank you!

Those functions have not changed since the 14 months ago, so quite a few versions. They have always been methods, which you should call directly on an instance of a TrainingArguments.